Summary
The text2cypher microservice currently lacks MCP (Model Context Protocol) support, preventing AI agents from utilizing its natural language to Cypher query translation capabilities. This feature request proposes adding MCP support to align with other microservices in the GenAIComps framework.
Problem Statement
As a developer building AI agent applications, I need the text2cypher microservice to support MCP so that AI agents can directly interact with Neo4j databases through natural language queries. Currently, AI agents cannot discover or use the text2cypher service through the standard MCP protocol, limiting integration possibilities.
Current State
- The text2cypher service is registered without MCP parameters in
/comps/text2cypher/src/opea_text2cypher_microservice.py
- Other microservices (feedback_management, prompt_registry, web_retrievers, etc.) already have MCP support
- No
/sse endpoint is exposed for MCP client connections
Proposed Solution
Add MCP support to text2cypher by updating the service registration to include:
enable_mcp parameter (controlled by environment variable)
mcp_func_type set to MCPFuncType.TOOL
- Descriptive
description for AI agent discovery
Implementation Details
# Add environment variable check
enable_mcp = os.getenv("ENABLE_MCP", "").strip().lower() in {"true", "1", "yes"}
# Update the service registration
@register_microservice(
name="opea_service@text2cypher",
service_type=ServiceType.TEXT2CYPHER,
endpoint="/v1/text2cypher",
host="0.0.0.0",
port=9097,
enable_mcp=enable_mcp,
mcp_func_type=MCPFuncType.TOOL,
description="Convert natural language queries to Neo4j Cypher queries for graph database operations"
)
Benefits
- AI Agent Integration: Enables AI agents to query Neo4j databases using natural language
- Consistency: Aligns text2cypher with other MCP-enabled microservices
- Flexibility: Environment variable control allows optional enablement
- Discoverability: AI agents can discover and understand the service capabilities
Testing Plan
Acceptance Criteria
- text2cypher service can be enabled with MCP support via
ENABLE_MCP environment variable
- Service is discoverable through MCP client tools
- AI agents can successfully execute natural language to Cypher translations
- No breaking changes to existing functionality
- Documentation updated to include MCP usage examples
Additional Context
- MCP implementation pattern is well-established in the codebase
- The change is minimal and follows existing conventions
- This enables powerful AI agent workflows for knowledge graph interactions
Summary
The text2cypher microservice currently lacks MCP (Model Context Protocol) support, preventing AI agents from utilizing its natural language to Cypher query translation capabilities. This feature request proposes adding MCP support to align with other microservices in the GenAIComps framework.
Problem Statement
As a developer building AI agent applications, I need the text2cypher microservice to support MCP so that AI agents can directly interact with Neo4j databases through natural language queries. Currently, AI agents cannot discover or use the text2cypher service through the standard MCP protocol, limiting integration possibilities.
Current State
/comps/text2cypher/src/opea_text2cypher_microservice.py/sseendpoint is exposed for MCP client connectionsProposed Solution
Add MCP support to text2cypher by updating the service registration to include:
enable_mcpparameter (controlled by environment variable)mcp_func_typeset toMCPFuncType.TOOLdescriptionfor AI agent discoveryImplementation Details
Benefits
Testing Plan
/sse) is exposed whenENABLE_MCP=trueOpeaMCPToolsManagertest_feedback_management_mcp.shAcceptance Criteria
ENABLE_MCPenvironment variableAdditional Context