File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717MCP_SERVER_INSTRUCTIONS = """
1818This MCP server defines search and document retrieval capabilities
19- for data in the Materials Project.
20- Use the search tool to find relevant documents based on materials
21- keywords.
19+ for data in the Materials Project (https://next-gen.materialsproject.org/).
20+ Use the search tool to find relevant documents based on materials keywords.
2221Then use the fetch tool to retrieve complete materials summary information.
2322"""
2423
@@ -82,5 +81,5 @@ def _run_mp_mcp_server() -> None:
8281 mcp .run (** parse_server_args ())
8382
8483
85- if __name__ == "__main__" :
84+ if __name__ == "__main__" : # pragma: no cover
8685 _run_mp_mcp_server ()
Original file line number Diff line number Diff line change 1010 )
1111
1212from mp_api .client .core .exceptions import MPRestError
13- from mp_api .mcp .server import get_core_mcp , parse_server_args
13+ from mp_api .mcp .server import get_core_mcp , parse_server_args , MCP_SERVER_INSTRUCTIONS
1414
1515
1616async def get_mcp_tools ():
@@ -35,6 +35,10 @@ def test_mcp_server():
3535 fetch_tool = asyncio .run (get_mcp_tool ("fetch" ))
3636 assert fetch_tool .parameters ["properties" ] == {"idx" : {"type" : "string" }}
3737
38+ mcp_server = get_core_mcp ()
39+ assert isinstance (mcp_server , fastmcp .FastMCP )
40+ assert mcp_server .instructions == MCP_SERVER_INSTRUCTIONS
41+
3842
3943def test_server_cli ():
4044 assert parse_server_args (
You can’t perform that action at this time.
0 commit comments