Skip to content

MCP Server: Schema-aware CRUD tools + file storage + scheduled functions #410

@ExpertVagabond

Description

@ExpertVagabond

Summary

The current MCP server is a great foundation — I've reviewed the tool implementations in npm-packages/convex/src/cli/lib/mcp/tools/ and see some high-impact additions that would make the Convex MCP experience significantly more powerful for AI agents (Claude Code, Cursor, etc.).

I'd like to contribute these. Sharing the proposal here per Graham's suggestion.

Proposed New Tools

1. Schema-Aware CRUD (highest impact)

Currently run.ts executes functions generically. The proposal is to auto-generate typed insert/update/delete tools from the project's schema.ts:

  • convex_insert — Insert a document with schema-validated fields
  • convex_patch — Update specific fields on a document by ID
  • convex_delete — Delete a document by ID
  • convex_get — Get a single document by ID (typed return)

The key difference from run: these tools would include the table's field names, types, and validators in their MCP tool schema, so the AI agent knows exactly what fields are available without reading source code.

2. File Storage

  • convex_storage_list — List stored files with metadata
  • convex_storage_get_url — Get a serving URL for a stored file
  • convex_storage_delete — Delete a stored file

3. Scheduled Functions

  • convex_crons_list — List all registered cron jobs and their schedules
  • convex_scheduled_list — List pending scheduled function calls
  • convex_scheduled_cancel — Cancel a pending scheduled function

Implementation Approach

  • Follow the existing ConvexTool pattern with Zod input schemas
  • Respect the existing --cautiously-allow-production-pii and --dangerously-enable-production-deployments flags
  • All new tools would be opt-in via the existing --disable-tools mechanism
  • Schema-aware tools would read from the deployed function spec (same as functionSpec.ts already does)

Context

I'm Matthew Karsten from Purple Squirrel Media. We've built and published 25+ MCP servers (710+ tools) across Solana, Shopify, cPanel, iMessage, and more. Happy to implement this as a PR if the team is interested.

Would you prefer a single PR with all tools, or separate PRs per category?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions