Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Multiple DATABASE connectors on one MCP server: tools/list silently exposes only the first connector's tools, and execute_query always routes to the first database

Chiusa
#1,296 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #1309 di @helpcodeai — integrata

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
api, backend, databases

Direzione di ricerca

Start with mcp-server.service.ts around lines 109–112, where connectors are ordered, and trace how the MCP endpoint builds tools/list and routes execute_query. The issue also points to the GraphQL and OData prefixing in connectors.controller.ts as an example to compare. Done means all three database tools are exposed per assigned connector and each executes against its own database; add or run endpoint tests for multiple connectors to verify this.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Description

Assigning two or more DATABASE connectors to the same MCP server silently drops all but the first connector's auto-generated tools from tools/list, and every call to the shared tool names (execute_query, get_database_schema, get_example_queries) is executed against the first-registered connector's database. The other databases are not just unlisted — they are completely unreachable through the per-server MCP endpoint, with no error or warning anywhere in the UI.

Multi-connector assignment is a core feature of AnythingMCP (mcp_server_connectors), so a legitimate server configuration serves the wrong (or incomplete) data silently.

Reproduced on self-hosted v0.29.0 (18aa018), and I verified the same code paths are unchanged on current main (6d1d895c, post-0.51.0), so this is not fixed yet.

Steps to Reproduce
  1. Create two or more DATABASE connectors in one workspace (reproduced with: mysql-domeos-beta MySQL, service-mesh-rw MySQL, context-forge-pg PostgreSQL).
  2. Assign all of them to one MCP server.
  3. Call tools/list on /mcp/{serverId} with a valid X-API-Key:
{"jsonrpc":"2.0","id":1,"method":"tools/list"}
  1. Result: 4 tools — execute_query, get_database_schema, get_example_queries (all with the first connector's flavor; MySQL in my case) plus kg_how_to_obtain. Expected 9 DB tools (3 per connector).
  2. Call execute_query with any SQL — it is always executed against the first-registered connector's database (registration order is orderBy: { id: 'asc' } in mcp-server.service.ts:109-112).

GET /api/mcp-servers/{id} confirms all 3 connectors are assigned (_count.connectors: 3), while /mcp/{id} serves only one connector's tools.

Expected Behavior
  • All 9 database tools are exposed (3 per connector), and each routes to its own connector's database.
  • Since the SDK requires unique tool names per McpServer instance, the natural design (already used elsewhere in the codebase — GraphQL and OData builtins prefix tools with the connector slug, e.g. buildGraphqlBuiltinTools({ prefix: slugifyForPrefix(dto.name) }) in connectors.controller.ts) is to namespace DATABASE builtins per connector, e.g. context_forge_pg_execute_query or similar.
  • At minimum, assigning a second DATABASE connector should surface a visible warning, since silent tool dropping is hard to notice.
Actual Behavior
  • tools/list returns 4 tools instead of 9+1; six tools silently vanish.
  • All calls to the shared names route to the first-registered connector — the other databases' data is unreachable, and execute_query returns plausible data from the wrong database, which is worse than an error: nothing suggests anything is missing.
  • The only trace is a rate-limited (once/hour) backend warn log:
    Duplicate tool name "execute_query" on server <id> — skipping the extra copy (check for duplicate connector assignments).
Connector Type

Database

Deployment Method

Docker Compose

Version

No response

Relevant Logs
WARN [McpEndpointController] Duplicate tool name "execute_query" on server <mcpServerId> — skipping the extra copy (check for duplicate connector assignments).
WARN [McpEndpointController] Duplicate tool name "get_database_schema" on server <mcpServerId> — skipping the extra copy (check for duplicate connector assignments).
WARN [McpEndpointController] Duplicate tool name "get_example_queries" on server <mcpServerId> — skipping the extra copy (check for duplicate connector assignments).
Environment
  • AnythingMCP v0.29.0, self-hosted
  • Connectors: 3× DATABASE (2× MySQL, 1× PostgreSQL)
  • MCP client: raw Streamable HTTP with X-API-Key
Lingua principale
TypeScript
Stelle
856
Fork
82
Merge medio
7h 49m
PR unite (30g)
302

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di HelpCode-ai/anythingmcp

Tutte le issue di HelpCode-ai/anythingmcp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.