Shepherd MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Shepherd MCP show me yesterday's sessions that had errors"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🐑 Shepherd MCP
MCP (Model Context Protocol) server for Shepherd - Debug your AI agents like you debug your code.
This MCP server allows AI assistants (Claude, Cursor, etc.) to query and analyze your AI agent sessions from multiple observability providers.
Supported Providers
AIOBS (Shepherd backend) - Native Shepherd observability
Langfuse - Open-source LLM observability platform
Related MCP server: AgentLens MCP Server
Installation
pip install shepherd-mcpOr run directly with uvx:
uvx shepherd-mcpConfiguration
Environment Variables
AIOBS (Shepherd)
AIOBS_API_KEY(required) - Your Shepherd API keyAIOBS_ENDPOINT(optional) - Custom API endpoint URL
Langfuse
LANGFUSE_PUBLIC_KEY(required) - Your Langfuse public API keyLANGFUSE_SECRET_KEY(required) - Your Langfuse secret API keyLANGFUSE_HOST(optional) - Custom Langfuse host URL (defaults to cloud.langfuse.com)
.env File Support
shepherd-mcp automatically loads .env files from the current directory or any parent directory. This means if you have a .env file in your project root:
# .env
# AIOBS
AIOBS_API_KEY=aiobs_sk_xxxx
# Langfuse
LANGFUSE_PUBLIC_KEY=pk-lf-xxxx
LANGFUSE_SECRET_KEY=sk-lf-xxxx
LANGFUSE_HOST=https://cloud.langfuse.comIt will be automatically loaded when the MCP server starts.
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"shepherd": {
"command": "uvx",
"args": ["shepherd-mcp"],
"env": {
"AIOBS_API_KEY": "aiobs_sk_xxxx",
"LANGFUSE_PUBLIC_KEY": "pk-lf-xxxx",
"LANGFUSE_SECRET_KEY": "sk-lf-xxxx",
"LANGFUSE_HOST": "https://cloud.langfuse.com"
}
}
}
}Cursor
Add to your .cursor/mcp.json:
{
"mcpServers": {
"shepherd": {
"command": "uvx",
"args": ["shepherd-mcp"],
"env": {
"AIOBS_API_KEY": "aiobs_sk_xxxx",
"LANGFUSE_PUBLIC_KEY": "pk-lf-xxxx",
"LANGFUSE_SECRET_KEY": "sk-lf-xxxx",
"LANGFUSE_HOST": "https://cloud.langfuse.com"
}
}
}
}Or if installed via pip:
{
"mcpServers": {
"shepherd": {
"command": "shepherd-mcp",
"env": {
"AIOBS_API_KEY": "aiobs_sk_xxxx",
"LANGFUSE_PUBLIC_KEY": "pk-lf-xxxx",
"LANGFUSE_SECRET_KEY": "sk-lf-xxxx",
"LANGFUSE_HOST": "https://cloud.langfuse.com"
}
}
}
}Available Tools
AIOBS (Shepherd) Tools
aiobs_list_sessions
List all AI agent sessions from Shepherd.
Parameters:
limit(optional): Maximum number of sessions to return
Example prompt:
"List my recent AI agent sessions from AIOBS"
aiobs_get_session
Get detailed information about a specific session including the full trace tree, LLM calls, function events, and evaluations.
Parameters:
session_id(required): The UUID of the session to retrieve
Example prompt:
"Get AIOBS session details for abc123-def456"
aiobs_search_sessions
Search and filter sessions with multiple criteria.
Parameters:
query(optional): Text search (matches name, ID, labels, metadata)labels(optional): Filter by labels as key-value pairsprovider(optional): Filter by LLM provider (e.g., 'openai', 'anthropic')model(optional): Filter by model name (e.g., 'gpt-4o-mini', 'claude-3')function(optional): Filter by function nameafter(optional): Sessions started after date (YYYY-MM-DD)before(optional): Sessions started before date (YYYY-MM-DD)has_errors(optional): Only return sessions with errorsevals_failed(optional): Only return sessions with failed evaluationslimit(optional): Maximum number of sessions to return
Example prompts:
"Find all AIOBS sessions that used OpenAI with errors" "Search for sessions from yesterday that failed evaluations"
aiobs_diff_sessions
Compare two sessions and show their differences including:
Metadata: Duration, labels, timestamps
LLM calls: Count, tokens (input/output/total), average latency, errors
Provider/Model distribution: Which providers and models were used
Function events: Total calls, unique functions, function-specific counts
Trace structure: Trace depth, root nodes
Evaluations: Pass/fail counts and rates
System prompts: Compare system prompts across sessions
Request parameters: Temperature, max_tokens, tools used
Response content: Content length, tool calls, stop reasons
Parameters:
session_id_1(required): First session UUID to comparesession_id_2(required): Second session UUID to compare
Example prompt:
"Compare AIOBS sessions abc123 and def456"
Langfuse Tools
langfuse_list_traces
List traces with pagination and filters. Traces represent complete workflows or conversations.
Parameters:
limit(optional): Maximum results per page (default: 50)page(optional): Page number (1-indexed)user_id(optional): Filter by user IDname(optional): Filter by trace namesession_id(optional): Filter by session IDtags(optional): Filter by tagsfrom_timestamp(optional): Filter after timestampto_timestamp(optional): Filter before timestamp
Example prompt:
"List the last 20 Langfuse traces"
langfuse_get_trace
Get a specific trace with its observations (generations, spans, events).
Parameters:
trace_id(required): The trace ID to fetch
Example prompt:
"Get Langfuse trace details for trace-id-123"
langfuse_list_sessions
List sessions with pagination. Sessions group related traces together.
Parameters:
limit(optional): Maximum results per pagepage(optional): Page numberfrom_timestamp(optional): Filter after timestampto_timestamp(optional): Filter before timestamp
Example prompt:
"Show me Langfuse sessions from the last week"
langfuse_get_session
Get a specific session with its metrics and traces.
Parameters:
session_id(required): The session ID to fetch
Example prompt:
"Get Langfuse session details for session-123"
langfuse_list_observations
List observations (generations, spans, events) with filters.
Parameters:
limit(optional): Maximum results per pagepage(optional): Page numbername(optional): Filter by observation nameuser_id(optional): Filter by user IDtrace_id(optional): Filter by trace IDtype(optional): Filter by type (GENERATION, SPAN, EVENT)from_timestamp(optional): Filter after timestampto_timestamp(optional): Filter before timestamp
Example prompt:
"List all GENERATION type observations from Langfuse"
langfuse_get_observation
Get a specific observation with full details including input, output, usage, and costs.
Parameters:
observation_id(required): The observation ID to fetch
Example prompt:
"Get details for Langfuse observation obs-123"
langfuse_list_scores
List scores/evaluations with filters.
Parameters:
limit(optional): Maximum results per pagepage(optional): Page numbername(optional): Filter by score nameuser_id(optional): Filter by user IDtrace_id(optional): Filter by trace IDfrom_timestamp(optional): Filter after timestampto_timestamp(optional): Filter before timestamp
Example prompt:
"Show me Langfuse scores for trace trace-123"
langfuse_get_score
Get a specific score/evaluation with full details.
Parameters:
score_id(required): The score ID to fetch
Example prompt:
"Get Langfuse score details for score-123"
Legacy Tools (Deprecated)
For backwards compatibility, the following tools are still available but will be removed in a future version:
list_sessions→ Useaiobs_list_sessionsget_session→ Useaiobs_get_sessionsearch_sessions→ Useaiobs_search_sessionsdiff_sessions→ Useaiobs_diff_sessions
Use Cases
1. Debugging Failed Runs
"Show me all AIOBS sessions that had errors in the last 24 hours"
2. Performance Analysis
"Compare AIOBS session abc123 with session def456 and tell me which one was more efficient"
3. Prompt Regression Detection
"Find Langfuse traces with failed evaluations"
4. Cost Tracking
"List Langfuse observations and summarize the total cost"
5. Session Inspection
"Get the full trace tree for the most recent Langfuse trace and explain what happened"
6. Cross-Provider Analysis
"Show me both AIOBS sessions and Langfuse traces from today"
Development
Setup
git clone https://github.com/neuralis/shepherd-mcp
cd shepherd-mcp
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"Running Tests
pytestRunning Locally
export AIOBS_API_KEY=aiobs_sk_xxxx
export LANGFUSE_PUBLIC_KEY=pk-lf-xxxx
export LANGFUSE_SECRET_KEY=sk-lf-xxxx
python -m shepherd_mcpPublishing to PyPI
Releases are automatically published to PyPI via GitHub Actions when a release is created.
To publish manually:
# Build the package
pip install build twine
python -m build
# Upload to PyPI
twine upload dist/*Architecture
src/shepherd_mcp/
├── __init__.py # Package exports
├── __main__.py # Entry point
├── server.py # MCP server with tool handlers
├── models/ # Data models
│ ├── __init__.py
│ ├── aiobs.py # AIOBS-specific models
│ └── langfuse.py # Langfuse-specific models
└── providers/ # Provider clients
├── __init__.py
├── base.py # Base provider interface
├── aiobs.py # AIOBS client implementation
└── langfuse.py # Langfuse client implementation┌─────────────────┐ stdio ┌─────────────────┐
│ Cursor/Claude │ ◄────────────► │ shepherd-mcp │
│ (Client) │ stdin/stdout │ (subprocess) │
└─────────────────┘ └────────┬────────┘
│ HTTPS
┌─────────┴─────────┐
│ │
▼ ▼
┌─────────────┐ ┌─────────────┐
│ Shepherd API│ │ Langfuse API│
│ (AIOBS) │ │ (Cloud) │
└─────────────┘ └─────────────┘License
MIT
Available Tools
18 toolsaiobs_diff_sessionsA
[AIOBS] Compare two AI agent sessions and show their differences including metadata, LLM calls, tokens, latency, providers, models, functions, evaluations, errors, system prompts, request parameters, and response content.
Inputs: session_id_1 (required), session_id_2 (required).
aiobs_get_sessionB
[AIOBS] Get detailed information about a specific AI agent session including the full trace tree, LLM calls, function events, and evaluations.
Inputs: session_id (required).
aiobs_list_sessionsB
[AIOBS] List all AI agent sessions from Shepherd. Returns session metadata, labels, and event counts.
Inputs: limit.
aiobs_search_sessionsB
[AIOBS] Search and filter AI agent sessions with multiple criteria including text search, labels, provider, model, function name, date range, errors, and failed evaluations.
Inputs: query, labels, provider, model, +6 more.
diff_sessionsB
[Deprecated: Use aiobs_diff_sessions] Compare two AI agent sessions.
Inputs: session_id_1 (required), session_id_2 (required).
get_sessionA
[Deprecated: Use aiobs_get_session] Get detailed information about a specific AI agent session.
Inputs: session_id (required).
langfuse_get_observationB
[Langfuse] Get a specific observation with full details including input, output, usage, and costs.
Inputs: observation_id (required).
langfuse_get_scoreC
[Langfuse] Get a specific score/evaluation with full details.
Inputs: score_id (required).
langfuse_get_sessionB
[Langfuse] Get a specific session with its metrics and aggregated data.
Inputs: session_id (required).
langfuse_get_traceB
[Langfuse] Get a specific trace with its observations. Returns full trace data including all observations (generations, spans, events).
Inputs: trace_id (required).
langfuse_list_observationsC
[Langfuse] List observations (generations, spans, events) with filters. Observations are the building blocks of traces.
Inputs: limit, page, name, user_id, +4 more.
langfuse_list_scoresC
[Langfuse] List scores/evaluations with filters. Scores are attached to traces or observations.
Inputs: limit, page, name, user_id, +3 more.
langfuse_list_sessionsC
[Langfuse] List sessions with pagination. Sessions group related traces together.
Inputs: limit, page, from_timestamp, to_timestamp.
langfuse_list_tracesA
[Langfuse] List traces with pagination and filters. Traces represent complete workflows or conversations.
Inputs: limit, page, user_id, name, +4 more.
langfuse_search_sessionsA
[Langfuse] Search and filter sessions with extended criteria including text search, user ID, trace count range, and cost range. Combines API-level and client-side filtering.
Inputs: query, user_id, min_traces, max_traces, +6 more.
langfuse_search_tracesC
[Langfuse] Search and filter traces with extended criteria including text search, release, cost range, and latency range. Combines API-level and client-side filtering.
Inputs: query, name, user_id, session_id, +10 more.
list_sessionsA
[Deprecated: Use aiobs_list_sessions] List all AI agent sessions from Shepherd.
Inputs: limit.
search_sessionsC
[Deprecated: Use aiobs_search_sessions] Search and filter AI agent sessions.
Inputs: query, labels, provider, model, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
The tools are organized into two clear domains (AIOBS and Langfuse), but within each domain there is significant overlap. For example, aiobs_list_sessions and aiobs_search_sessions both retrieve sessions, with the latter adding filtering, which could cause confusion about which to use. Similarly, langfuse_list_sessions and langfuse_search_sessions serve very similar purposes. The deprecated tools further add redundancy without clear differentiation from their AIOBS counterparts.
The naming follows a consistent prefix_verb_noun pattern (e.g., aiobs_diff_sessions, langfuse_get_observation), which is predictable and readable. However, there are minor deviations: some tools use 'list' while others use 'search' for similar operations, and the deprecated tools lack the prefix, breaking full consistency but not severely impacting usability.
With 18 tools, the count is borderline high for the scope, which appears to be monitoring and analyzing AI agent sessions and traces. The inclusion of deprecated tools (6 out of 18) inflates the number unnecessarily, making the set feel heavy and cluttered, though the core functionality is well-represented.
The tool set provides comprehensive coverage for querying and analyzing sessions, traces, observations, and scores across two systems (AIOBS and Langfuse), with operations like get, list, search, and diff. Minor gaps might include update or delete operations, but these are likely not needed for the monitoring domain, and agents can work effectively with the provided read-oriented tools.
Maintenance
Related MCP Connectors
Query your app's logs, metrics and incidents from your AI assistant.
AI agent observability for production traces, natural-language insights, and improvement loops.
Production observability for AI agents: search runs, read evaluations, acknowledge incidents.
Query your AI agents' traces, errors, cost and alerts in Rius, the agent observability platform.
Related MCP Servers
- FlicenseAqualityBmaintenanceEnables monitoring and analysis of agent goal achievement and failures across sessions, repos, and tools, with detailed views and tracing.3-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to access observability and evaluation data, including run history, span traces, LLM-as-judge evaluation results, and regression reports.MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to query and debug trace, session, observation, and exception data, analyze latency and metrics, and manage prompts, datasets, and annotation queues. Supports selective tool-group loading, compact or file-dump output, and a read-only mode for safer access.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to query and debug Langfuse trace data, including traces, sessions, exceptions, route decisions, prompts, datasets, and metrics, for enhanced debugging and observability.-