Ollama
Ollama is a local LLM server — it serves models but does not consume MCP tools directly. To use AllMCP with a local Ollama model, pair Ollama with a framework that supports both a custom LLM backend and MCP.
Pick a framework
Section titled “Pick a framework”Both approaches below connect a locally served Ollama model to AllMCP. Choose the one that matches your stack.
LangChain + Ollama + AllMCP
pip install langchain-mcp-adapters langchain-ollama langgraphimport asynciofrom langchain_mcp_adapters.client import MultiServerMCPClientfrom langchain_ollama import ChatOllamafrom 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()
llm = ChatOllama( model="llama3.2", base_url="http://localhost:11434", )
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 + Ollama + AllMCP
pip install 'pydantic-ai-slim[mcp]' ollamafrom pydantic_ai import Agentfrom pydantic_ai.mcp import MCPServerStreamableHTTPfrom pydantic_ai.models.openai import OpenAIModelfrom openai import AsyncOpenAI
# Ollama's OpenAI-compatible endpointollama_client = AsyncOpenAI(base_url="http://localhost:11434/v1", api_key="ollama")model = OpenAIModel("llama3.2", openai_client=ollama_client)
allmcp = MCPServerStreamableHTTP( url="https://go.allmcp.co/mcp/", headers={"X-API-Key": "YOUR_API_KEY"},)
agent = Agent(model, toolsets=[allmcp])Model compatibility
Section titled “Model compatibility”AllMCP tools work best with models that have strong function-calling support:
| Model | Tool use quality |
|---|---|
llama3.2 | Good |
llama3.1 | Good |
mistral-nemo | Good |
qwen2.5 | Good |
phi3 | Limited |
Keep exploring
Section titled “Keep exploring” Browse providers See every provider you can connect and the tools each one offers.