From 80af115e59ac4f331387596e3bcce9e80709c458 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 24 Jul 2026 17:40:49 +0000 Subject: [PATCH] =?UTF-8?q?Add=20MCP=20prompts=20=E2=80=94=20slash=20comma?= =?UTF-8?q?nds=20for=20Claude=20Desktop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Five prompts exposed via @mcp.prompt() that appear as slash commands in Claude Desktop: find_concept(concept) — search + show alignments compare_schemas(schema_a, schema_b)— diff two schemas map_record(source, target) — guided record transform submit_schema(schema_name) — walk through schema submission registry_overview() — full registry snapshot Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01EXeTeJsXisxTRXay6EoBSQ --- neuro_ghost/mcp_server.py | 72 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/neuro_ghost/mcp_server.py b/neuro_ghost/mcp_server.py index 6a8e16e..637101e 100644 --- a/neuro_ghost/mcp_server.py +++ b/neuro_ghost/mcp_server.py @@ -423,6 +423,78 @@ def ingest_schema( return {"status": "created", "issue_url": resp["html_url"]} +# --------------------------------------------------------------------------- +# Prompts — show up as slash commands in Claude Desktop +# --------------------------------------------------------------------------- + +@mcp.prompt() +def find_concept(concept: str) -> str: + """Find a neuroscience concept across all registered schemas and show alignments.""" + return ( + f"Search the NeuroGhost registry for '{concept}':\n" + f"1. Call search_classes(query='{concept}') to find matching classes.\n" + f"2. For the top result, call get_alignments(class_name=) to show " + f"how it aligns across schemas.\n" + f"3. Summarise: what schemas define this concept, how similar are they, " + f"and what SKOS relation links them (exactMatch, closeMatch, etc.)." + ) + + +@mcp.prompt() +def compare_schemas(schema_a: str, schema_b: str) -> str: + """Diff two schemas — which classes overlap and which are unique to each.""" + return ( + f"Compare the '{schema_a}' and '{schema_b}' schemas in NeuroGhost:\n" + f"1. Call diff_schemas(source_a='{schema_a}', source_b='{schema_b}').\n" + f"2. Report: how many classes are shared vs unique to each schema, " + f"list the top 5 closest shared pairs by distance score, and highlight " + f"any classes that appear only in one schema but have no close equivalent " + f"in the other." + ) + + +@mcp.prompt() +def map_record(source_schema: str, target_schema: str) -> str: + """Guide for transforming a data record from one schema to another.""" + return ( + f"I want to transform a data record from '{source_schema}' format to " + f"'{target_schema}' format using NeuroGhost.\n\n" + f"Please:\n" + f"1. Call list_sources() so I can see which schemas are registered.\n" + f"2. Ask me to paste my '{source_schema}' record as a JSON dict.\n" + f"3. Call transform_record(source_schema='{source_schema}', " + f"target_schema='{target_schema}', record=).\n" + f"4. Show me the mapped fields, any unmapped fields, and explain what " + f"alignment edges were used." + ) + + +@mcp.prompt() +def submit_schema(schema_name: str) -> str: + """Walk through submitting a new LinkML schema to the NeuroGhost registry.""" + return ( + f"I want to submit a new schema called '{schema_name}' to NeuroGhost.\n\n" + f"Please guide me through:\n" + f"1. Call list_sources() to confirm '{schema_name}' isn't already registered.\n" + f"2. Ask me to paste my LinkML YAML.\n" + f"3. Call ingest_schema(schema_yaml=, schema_name='{schema_name}') " + f"— if I have a GitHub token I'll provide it, otherwise use the manual URL.\n" + f"4. Explain what happens next (CI validates, aligns, and archives it)." + ) + + +@mcp.prompt() +def registry_overview() -> str: + """Get a quick overview of everything currently in the NeuroGhost registry.""" + return ( + "Give me a quick overview of the NeuroGhost registry:\n" + "1. Call list_sources() and summarise each schema (name, class count, version).\n" + "2. Call get_provenance() and show the 3 most recent registry updates.\n" + "3. Pick the two largest schemas and call diff_schemas() on them — " + "how much do they overlap?" + ) + + # --------------------------------------------------------------------------- # Entry point # ---------------------------------------------------------------------------