File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33from emmet .core .synthesis import (
44 OperationTypeEnum ,
5- SynthesisSearchResultModel ,
5+ SynthesisRecipe ,
66 SynthesisTypeEnum ,
77)
88
1111
1212class SynthesisRester (BaseRester ):
1313 suffix = "materials/synthesis"
14- document_model = SynthesisSearchResultModel # type: ignore
14+ document_model = SynthesisRecipe # type: ignore
1515
1616 def search (
1717 self ,
@@ -29,7 +29,7 @@ def search(
2929 condition_mixing_media : list [str ] | None = None ,
3030 num_chunks : int | None = None ,
3131 chunk_size : int | None = 10 ,
32- ) -> list [SynthesisSearchResultModel ] | list [dict ]:
32+ ) -> list [SynthesisRecipe ] | list [dict ]:
3333 """Search synthesis recipe text.
3434
3535 Arguments:
@@ -50,7 +50,7 @@ def search(
5050
5151
5252 Returns:
53- ([SynthesisSearchResultModel ], [dict]): List of synthesis documents or dictionaries.
53+ ([SynthesisRecipe ], [dict]): List of synthesis documents or dictionaries.
5454 """
5555 # Turn None and empty list into None
5656 keywords = keywords or None
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