The mcp.ts
script manages the Model Context Protocol (MCP) server for Convex, facilitating interaction with AI tools.
Key features:
- MCP Server Management: Commands to initialize and run the MCP server.
- Tool Disabling: Option to disable specific tools via the
--disable-tools
flag. - Environment Control: Option to disable access to production deployments with
--disable-production-deployments
. - Deployment Selection: Integrates with deployment selection options.
- Request Handling: Handles
CallToolRequestSchema
andListToolsRequestSchema
to process tool calls and list available tools. - Authorization: Checks authorization before executing tool calls.
- Error Handling: Provides robust error handling and reporting.
Use cases:
- Exposing Convex codebase to AI tools.
- Creating structured interactions between AI and Convex functions.
- Automating tasks using AI with access to Convex data and logic.