Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de 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

Cerrado
#1,296 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Ya se ha fusionado un pull request relacionado.

  • #1309 de @helpcodeai — fusionado

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
TypeScript
Estrellas
856
Forks
82
Merge medio
7 h 49 min
PR fusionados (30 d)
302

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de HelpCode-ai/anythingmcp

Todos los issues de HelpCode-ai/anythingmcp

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.