feat: MCP server endpoint with list_services tool (Stories 2.1 + 2.3)#129
Merged
farovictor merged 3 commits intomainfrom Apr 5, 2026
Merged
feat: MCP server endpoint with list_services tool (Stories 2.1 + 2.3)#129farovictor merged 3 commits intomainfrom
farovictor merged 3 commits intomainfrom
Conversation
- Add POST /mcp — JSON-RPC 2.0 MCP server endpoint - initialize: returns protocol version, server name/version, capabilities - tools/list: returns available tools with input schemas - tools/call: dispatches to tool handlers - Implement list_services MCP tool: returns service name + base_url, never includes real credentials - Require X-API-Key auth on /mcp — unauthenticated requests return 401 - Wire /mcp in main.go and test setupRouter - Add 8 tests covering auth, initialize, tools/list, list_services (empty + with data + no credential leak), unknown method/tool, invalid version Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Empty id allowed keys to be created with no name, making them unreferenceable and impossible to delete via the UI or API. Empty target bypassed service validation entirely. Both now return 400 "id and target are required". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /mcp— a JSON-RPC 2.0 MCP server endpoint behindX-API-Keyauthinitialize,tools/list, andtools/callmethodslist_servicesMCP tool: returns service name + base URL, credentials never includedrequest_keyin the tools list (implemented in Story 2.2)/mcpinmain.goandsetupRouterin testsMCP protocol
Test plan
go test ./...greencurl -X POST http://localhost:3333/mcp -H "X-API-Key: secret" -d '{"jsonrpc":"2.0","id":1,"method":"initialize"}'🤖 Generated with Claude Code