Skip to main content
Glama

Muse Glimmer + MCP + Langfuse(本地)

一个极简 Pydantic AI 智能体,它:

  • 通过本地 Ollama 实例运行 muse-glimmer(Meta 的 30B 智能体模型),

  • 启用 MCP:一个本地 FastMCP 服务器(mcp_server.py)以 stdio 子进程的形式附加,将 get_weatherget_current_timelist_ollama_models 暴露为智能体工具,

  • 将完整追踪(模型请求、工具调用、输出)发送到本地 Langfuse 实例,用于可观测性。

前置条件

  • Ollama 已运行并已拉取模型:

    ollama pull muse-glimmer
  • 一个可通过 http://localhost:3000 访问的本地 Langfuse 实例(例如通过 Langfuse 仓库的 docker compose 启动)。

  • uv(或使用 python3 -m venv + pip)。

Related MCP server: MCP Ollama Consult Server

配置

cp .env.example .env   # then fill in your Langfuse keys
uv sync                # installs pydantic-ai, fastmcp, langfuse, ...

.env

LANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
LANGFUSE_BASE_URL=http://localhost:3000
LANGFUSE_HOST=http://localhost:3000

OLLAMA_BASE_URL=http://localhost:11434/v1
OLLAMA_MODEL=muse-glimmer

运行

uv run python agent.py

智能体会回答三个演示提示词,并在需要时调用 MCP 工具:

🧑  User: What is the weather in Paris today?
🤖  Agent: Weather in Paris: clear skies, 22°C, humidity 51%.

🧑  User: What time is it in Tokyo right now?
🤖  Agent: The current time in Asia/Tokyo is 2026-08-25 21:04:33 JST.

🧑  User: Which Ollama models are available locally?
🤖  Agent: NAME  ID  SIZE  MODIFIED ...

可观测性(Langfuse)

打开 http://localhost:3000Traces。每次运行都会产生名为 muse-glimmer-mcp-agent 的 trace,其中包含模型请求(输入/输出 token)和每次 MCP 工具调用的 span——可检查输入、输出、延迟和成本。

将智能体暴露为 MCP 服务器

agent_mcp_server.py 将架构调转过来:智能体本身成为一个 MCP 服务器,向任何 MCP 客户端(Claude Desktop、VS Code、Cursor、另一个 Pydantic AI 智能体等)暴露一个工具——ask_agent(prompt)。每次调用都会通过 Ollama 运行 muse-glimmer,仍然拥有内部的 MCP 工具,并会被追踪到 Langfuse。

运行服务器

uv run python agent_mcp_server.py

客户端配置

使用由 uv 管理的 venv 中的 Python 将任意 MCP 客户端指向此服务器(uv run --project <repo> python 也可用)。示例:

Claude Desktop —— claude_desktop_config.json

{
  "mcpServers": {
    "muse-glimmer-agent": {
      "command": "/home/d3lee/.local/bin/uv",
      "args": ["run", "--project", "/home/d3lee/my-repos/pydantic-ai-mcp-server-sample", "python", "agent_mcp_server.py"]
    }
  }
}

VS Code —— .vscode/mcp.json

{
  "servers": {
    "muse-glimmer-agent": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "--project", "/home/d3lee/my-repos/pydantic-ai-mcp-server-sample", "python", "agent_mcp_server.py"]
    }
  }
}

Cursor —— .cursor/mcp.json

{
  "mcpServers": {
    "muse-glimmer-agent": {
      "command": "uv",
      "args": ["run", "--project", "/home/d3lee/my-repos/pydantic-ai-mcp-server-sample", "python", "agent_mcp_server.py"]
    }
  }
}

文件布局

文件

用途

agent.py

Pydantic AI 智能体:Ollama 模型 + MCP 能力 + Langfuse

mcp_server.py

FastMCP 服务器(stdio),暴露本地工具

agent_mcp_server.py

将智能体自身暴露为 MCP 服务器(ask_agent 工具)

.env

Langfuse + Ollama 配置

pydantic-ai-mcp-server-sample

Install Server
F
license - not found
B
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Tools

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Enables seamless integration between Ollama's local LLM models and MCP-compatible applications, supporting model management and chat interactions.
    13
    1,209
    171
    AGPL 3.0
  • A
    license
    A
    quality
    C
    maintenance
    Enables consulting with local Ollama models for reasoning from alternative viewpoints. Supports sending prompts to Ollama models and listing available models on your local Ollama instance.
    5
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server exposing the Backtest360 engine API as tools for AI agents.

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/saram-io/pydantic-ai-mcp-server-sample'

If you have feedback or need assistance with the MCP directory API, please join our Discord server