Make Any API MCP Ready with TakeShape
warning
TakeShape's AI-related features are considered experimental. Use in production with the knowledge that these features may change.
Introduction
Model Context Protocol (MCP) is an open protocol that allows AI models to generate context in a standardized way. You can read more about MPC here.
This article will walk you through exposing a query in TakeShape with MCP, and then using that query as a tool in Claude Desktop.
Exposing a Query with MCP
You can expose any query in a TakeShape project, but for the sake of this guide we will start by creating a new project and connecting an external API which we then expose as an MCP tool.
- Create a blank project in TakeShape.
- Connect the Rick & Morty API to your project. You can do this by clicking on
Add Service
, enteringRick
as the name andhttps://rickandmortyapi.com/graphql
as the URL. Then clickSave
. - Click the
Create
button in the top right, and then selectNew AI Tool
from the dropdown.
- Provide a unique name for your tool,
listEpisodes
works. - Select
episodes
as a query from theQuery or Mutation
dropdown. - The
page
argument will prepopulate. You can leave it as is. - Add a selection set to the query. You can use the following:
{
info {
pages
}
results {
air_date
characters {
name
}
created
episode
id
name
}
}
- Deploy the schema changes.
Creating an API Key
- Click on the
Settings
tab, thenAPI Keys
and add an API key with theread
role. - Copy the new API key somewhere safe, you will need it later.
Using the Tool in Claude Desktop
- Follow the instruction to setup an MCP server in Claude.
- Edit the
claude_desktop_config.json
file to add a remote connection to your TakeShape project. Note that you will need to replaceYOUR_PROJECT_ID
with your TakeShape project ID andYOUR_API_KEY
with the API key you created in the previous section. You will also need to be sure Claude has access to thenpx
executable, which may involve setting yourPATH
env var.
The claude_desktop_config.json
file should look like this:
{
"mcpServers": {
"takeshape": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://api.takeshape.io/project/YOUR_PROJECT_ID/mcp",
"--header",
"Authorization: Bearer ${AUTH_TOKEN}"
],
"env": {
"PATH": "/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
"AUTH_TOKEN": "YOUR_API_KEY"
}
}
}
}
- Restart Claude Desktop.
- Check your Claude tools, it should include the
takeshape
server and yourlistEpisodes
tool under it.
- Ask Claude something that will make use of your
listEpisodes
tool. You can try the following prompt:
Get me some Rick and Morty episodes.