Skip to content

MCP: add Prompts (graphrag_query, build_knowledge_graph) #4866

Description

@robfrank

Part of #4859.

Motivation

MCP Prompts are entirely unimplemented (confirmed alongside Resources — zero matches for prompts/list/prompts/get). Guided prompt templates steer models toward correct, safe use of the new retrieval/upsert tools instead of reaching for raw execute_command with hand-written vector/MERGE syntax — this is architecturally higher-leverage than adding more tools, per the governing principle in #4859.

Proposed design

  • Implement prompts/list and prompts/get in both transports; advertise capabilities.prompts = {listChanged: false}.
  • graphrag_query prompt: arguments {database, question}; template instructs the model to call vector_search/hybrid_search/full_text_search as appropriate and cite retrieved rids.
  • build_knowledge_graph prompt: arguments {database, sourceText}; template instructs the model to extract entities/relationships and call upsert_entity/upsert_relationship, emphasizing match-key selection to avoid duplicates.
  • New package server/src/main/java/com/arcadedb/server/mcp/prompts/ mirroring the tools/ pattern (one class per prompt with getDefinition()/getMessages(args)).

Acceptance criteria

  • prompts/list returns both prompts with argument schemas.
  • prompts/get returns well-formed message arrays referencing actual, currently-registered tool names (test should fail if a referenced tool is renamed/removed).
  • Both transports covered; tests + docs (including the literal prompt text for review).

Files to touch

server/src/main/java/com/arcadedb/server/mcp/prompts/GraphRagQueryPrompt.java, BuildKnowledgeGraphPrompt.java (new), MCPHttpHandler.java, MCPStdioServer.java, tests, docs.

Dependencies

Blocked-by #4860 (vector_search), #4861 (hybrid_search), #4864 (upsert_entity/upsert_relationship) — prompt text references these tools by name, so sequence after those tool names are finalized.

Effort estimate

M — new protocol primitive, prompt-text design/iteration, cross-reference test.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmcpModel Context Protocol server

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions