Skip to main content
Glama

Muse Glimmer + MCP + Langfuse(ローカル)

最小限の Pydantic AI エージェントで、以下を実現します:

  • muse-glimmer(Meta の 30B エージェントモデル)を ローカルの Ollama インスタンス経由で実行し、

  • MCP を有効化:ローカルの FastMCP サーバー(mcp_server.py)を stdio サブプロセスとして接続し、get_weatherget_current_timelist_ollama_models をエージェントツールとして公開。

  • 可観測性のため、完全なトレース(モデルリクエスト、ツール呼び出し、出力)を ローカルの Langfuse インスタンスに送信します。

前提条件

  • Ollama が実行中で、モデルがプル済みであること:

    ollama pull muse-glimmer
  • ローカルの Langfuse インスタンス(例:Langfuse リポジトリの docker compose を使用)が http://localhost:3000 でアクセス可能であること。

  • 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

エージェントはデモ用の3つのプロンプトに回答し、必要に応じて 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:3000 を開き、トレース を確認。実行ごとに muse-glimmer-mcp-agent という名前のトレースが生成され、モデルリクエスト(入出力トークン)と各 MCP ツール呼び出しのスパンが含まれます。入力、出力、レイテンシー、コストを確認できます。

エージェントを MCP サーバーとして公開する

agent_mcp_server.py はアーキテクチャを反転させます。エージェント自体が MCP サーバー になり、任意の MCP クライアント(Claude Desktop、VS Code、Cursor、別の Pydantic AI エージェントなど)に対して ask_agent(prompt) という1つのツールを公開します。各呼び出しでは Ollama 経由で muse-glimmer を実行し、内部の MCP ツールも保持したまま Langfuse にトレースされます。

サーバーの実行

uv run python agent_mcp_server.py

クライアント設定

任意の MCP クライアントをこのサーバーに設定するには、uv 管理の venv の Python を使用します(uv run --project <repo> python でも動作します)。例:

Claude Desktopclaude_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