Skip to content

Commit 7dcf96b

Browse files
add mcp inspector tool
1 parent 2d3b0ba commit 7dcf96b

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

dev/inspect_mcp.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash -l
2+
3+
# Tool to run the MCP inspector:
4+
# https://modelcontextprotocol.io/docs/tools/inspector
5+
6+
server_path=$(python -c 'from importlib_resources import files ; print(str((files("mp_api.client") / ".."/ "..").resolve()))')
7+
8+
fastmcp dev \
9+
--python 3.12 \
10+
--with-editable $server_path \
11+
--with-requirements "$server_path/requirements/requirements-ubuntu-latest_py3.12_extras.txt" \
12+
"$server_path/mp_api/mcp/server.py"

mp_api/mcp/mp_mcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def get_openai_compat_mcp() -> FastMCP:
2626
)
2727
openai_compat_tools = MPOpenAIMcpTools()
2828
for k in {"search", "fetch"}:
29-
mp_mcp.tool(getattr(openai_compat_tools, k))
29+
mp_mcp.tool(getattr(openai_compat_tools, k), name=k)
3030
return mp_mcp
3131

3232

mp_api/mcp/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def search(self, query: str) -> OpenAISearchOutput:
5454
return OpenAISearchOutput(
5555
retults=[
5656
OpenAIResult(id=doc["material_id"], text=doc["description"])
57-
for doc in self.client.robocrys.search(query.split(","))
57+
for doc in self.client.robocrys.search(query)
5858
]
5959
)
6060

0 commit comments

Comments
 (0)