feat: add remote MCP endpoint for external agent access

- Add app/api/mcp/route.ts with read-only ls_* tools
- Tools: ls_search_nodes, ls_get_nodes, ls_query_edges, ls_list_dimensions
- Uses WebStandardStreamableHTTPServerTransport for Vercel serverless
- Stateless mode (sessionIdGenerator: undefined) for proper serverless execution
- CORS headers for cross-origin agent access
- GET endpoint returns server info for debugging

Usage: claude mcp add --transport http latent-space https://latentspace.ra-h.app/api/mcp
This commit is contained in:
“BeeRad”
2026-01-30 08:01:28 +11:00
parent f67d6af862
commit f3d240c604
3 changed files with 1153 additions and 14 deletions
+1
View File
@@ -24,6 +24,7 @@
"@ai-sdk/openai": "^3.0.7",
"@langchain/core": "^1.0.1",
"@langchain/textsplitters": "^1.0.1",
"@modelcontextprotocol/sdk": "^1.25.3",
"@xyflow/react": "^12.10.0",
"ai": "^6.0.27",
"better-sqlite3": "^12.2.0",