LM Studio
LM Studio is a local LLM server — it serves models but does not consume MCP tools directly. To use AllMCP with an LM Studio model, pair it with a framework that supports both a custom LLM backend and MCP.
Pick your framework
Section titled “Pick your framework”Both approaches keep the LLM local in LM Studio while AllMCP serves the tools remotely. Choose the one that matches the framework you already use.
Recommended approach: LangChain + LM Studio + AllMCP
pip install langchain-mcp-adapters langchain-openai langgraphimport asynciofrom langchain_mcp_adapters.client import MultiServerMCPClientfrom langchain_openai import ChatOpenAIfrom langgraph.prebuilt import create_react_agent
async def main(): client = MultiServerMCPClient({ "allmcp": { "url": "https://go.allmcp.co/mcp/", "transport": "streamable_http", "headers": {"X-API-Key": "YOUR_API_KEY"}, } }) tools = await client.get_tools()
# LM Studio's OpenAI-compatible endpoint llm = ChatOpenAI( base_url="http://localhost:1234/v1", api_key="lm-studio", # any non-empty string model="local-model", # matches the model loaded in LM Studio )
agent = create_react_agent(llm, tools)
result = await agent.ainvoke({ "messages": [{"role": "user", "content": "List my Bitrix24 contacts"}] }) print(result["messages"][-1].content)
asyncio.run(main())PydanticAI + LM Studio + AllMCP
from pydantic_ai import Agentfrom pydantic_ai.mcp import MCPServerStreamableHTTPfrom pydantic_ai.models.openai import OpenAIModelfrom openai import AsyncOpenAI
lm_studio_client = AsyncOpenAI( base_url="http://localhost:1234/v1", api_key="lm-studio",)model = OpenAIModel("local-model", openai_client=lm_studio_client)
allmcp = MCPServerStreamableHTTP( url="https://go.allmcp.co/mcp/", headers={"X-API-Key": "YOUR_API_KEY"},)
agent = Agent(model, toolsets=[allmcp])Model tips
Section titled “Model tips”See also
Section titled “See also” Browse providers See every provider you can connect and the tools each one offers.