File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import httpx
77from fastmcp import FastMCP
88
9- from mp_api .mcp .tools import MPMcpTools , MPOpenAIMcpTools
9+ from mp_api .mcp .tools import MPCoreMCP , MPMcpTools
1010from mp_api .mcp .utils import _NeedsMPClient
1111
1212MCP_SERVER_INSTRUCTIONS = """
1818"""
1919
2020
21- def get_openai_compat_mcp () -> FastMCP :
22- """Create MCP for compatibility with OpenAI models."""
21+ def get_core_mcp () -> FastMCP :
22+ """Create an MCP compatible with OpenAI models."""
2323 mp_mcp = FastMCP (
2424 "Materials_Project_MCP" ,
2525 instructions = MCP_SERVER_INSTRUCTIONS ,
2626 )
27- openai_compat_tools = MPOpenAIMcpTools ()
27+ core_tools = MPCoreMCP ()
2828 for k in {"search" , "fetch" }:
29- mp_mcp .tool (getattr (openai_compat_tools , k ), name = k )
29+ mp_mcp .tool (getattr (core_tools , k ), name = k )
3030 return mp_mcp
3131
3232
Original file line number Diff line number Diff line change 11"""Run MCP."""
22from __future__ import annotations
33
4- from mp_api .mcp .mp_mcp import get_openai_compat_mcp
4+ from mp_api .mcp .mp_mcp import get_core_mcp
55
6- mcp = get_openai_compat_mcp ()
6+ mcp = get_core_mcp ()
77
88if __name__ == "__main__" :
99 mcp .run ()
Original file line number Diff line number Diff line change 3333from mp_api .mcp ._schemas import SearchOutput , FetchResult , MaterialMetadata
3434
3535
36- class MaterialsProjectCoreMcp (_NeedsMPClient ):
36+ class MPCoreMCP (_NeedsMPClient ):
3737 """Define LLM-agnostic MCP for the Materials Project API.
3838
3939 Because this MCP must support all common LLMs, it defines two methods,
You can’t perform that action at this time.
0 commit comments