Skip to content

feat: implement MCP endpoint#43

Open
bazmatic wants to merge 14 commits intomainfrom
feat/mcp-endpoint
Open

feat: implement MCP endpoint#43
bazmatic wants to merge 14 commits intomainfrom
feat/mcp-endpoint

Conversation

@bazmatic
Copy link

@bazmatic bazmatic commented Dec 2, 2025

Purpose

  • Implement MCP (Model Context Protocol) endpoint for the Next.js application
  • Enable AI assistants (Claude Desktop, Cursor) to interact with the application's post management system via MCP

Approach

  • Created a @acme/mcp package
  • Implemented MCP handler using mcp-handler library (Vercel's MCP adapter) with example tools for basic arithmetic.
  • Created minimal API route at /api/mcp that imports and configures the handler from @acme/mcp package
  • Added optional REDIS_URL environment variable support for SSE resumability in serverless environments
  • Configured mcp.json for MCP client connection

QA

  • Endpoint: http://localhost:3000/api/mcp (development)
  • MCP Client Setup: Configure MCP client (Cursor/Claude Desktop) using mcp.json:
  • Tool Testing: Once connected, test tools via MCP client
  • Before: No MCP endpoint existed
  • After: Full MCP protocol support with tools available to AI assistants

Example run with Cursor

Screenshot 2025-12-19 at 10 12 45 am

@bazmatic bazmatic changed the title feat: implement MCP endpoint with post management tools feat: implement MCP endpoint Dec 2, 2025
@ecoologic ecoologic marked this pull request as draft December 4, 2025 23:21
@ecoologic
Copy link

Moving to draft till it passes CI.

@bazmatic bazmatic marked this pull request as ready for review December 10, 2025 03:13
Copy link

@sjustintaylor sjustintaylor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oprah Crazy

Copy link

@ecoologic ecoologic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all these files going to carry over to the created projects, was that tested? I found that not all the files in there end up in the prj when you use npx create-turbo ....

- Create @acme/mcp package with zod v3 for mcp-handler compatibility
- Add MCP API route handler at /api/mcp
- Implement 4 MCP tools: list_posts, get_post, create_post, delete_post
- Add REDIS_URL to environment schema for SSE resumability
- Configure mcp.json for client connection
- Add comprehensive setup documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants