Model Context Protocol (MCP) server for Runtype API
npm install @runtypelabs/mcpModel Context Protocol (MCP) server for Runtype API.
> Official MCP client package available on npm
``bash`
npm install @runtypelabs/mcpor
pnpm add @runtypelabs/mcp
Run the MCP server locally for use with Claude Desktop, Cursor, or other MCP clients:
`bash`
RUNTYPE_API_KEY=tv_xxx npx @runtypelabs/mcp
#### Claude Desktop Configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
`json`
{
"mcpServers": {
"runtype": {
"command": "npx",
"args": ["@runtypelabs/mcp"],
"env": {
"RUNTYPE_API_KEY": "tv_your_api_key_here"
}
}
}
}
#### Cursor Configuration
Add to ~/.cursor/mcp.json:
`json`
{
"mcpServers": {
"runtype": {
"command": "npx",
"args": ["@runtypelabs/mcp"],
"env": {
"RUNTYPE_API_KEY": "tv_your_api_key_here"
}
}
}
}
You can also use the hosted MCP endpoint at https://api.runtype.com/v1/mcp/protocol:
`json`
{
"mcpServers": {
"runtype": {
"url": "https://api.runtype.com/v1/mcp/protocol",
"headers": {
"Authorization": "Bearer tv_your_api_key_here"
}
}
}
}
`typescript
import { createMcpServer, RuntypeApiClient } from "@runtypelabs/mcp"
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
// Create API client
const client = new RuntypeApiClient({
apiKey: "tv_xxx",
baseUrl: "https://api.runtype.com",
})
// Create MCP server
const server = createMcpServer({ apiClient: client })
// Connect with your transport of choice
const transport = new StdioServerTransport()
await server.connect(transport)
`
| Variable | Description | Default |
|----------|-------------|---------|
| RUNTYPE_API_KEY | Your Runtype API key | (required) |RUNTYPE_API_URL
| | API base URL | https://api.runtype.com |
| Tool | Description |
|------|-------------|
| dispatch | Execute a flow with optional record context |list_flows
| | List available flows |get_flow
| | Get flow details |run_flow
| | Execute a flow by ID |list_records
| | List records |get_record
| | Get record details |create_record
| | Create a new record |update_record
| | Update a record |list_tools
| | List available tools |execute_tool
| | Execute a tool |run_prompt` | Run a prompt directly |
|
MIT