使用说明
Atla MCP服务器
MCP服务器实现为LLM提供了一个标准化的接口,用于与Atla SDK交互并使用我们的 最先进的评估模型.
特性
- 与Selene 1一起评估个人反应
- 使用Selene 1进行批量评估
- 列出可用的评估指标,创建新的指标或按名称获取
安装
- 分叉存储库并在某个目录中本地克隆它。这将定义您的
path/to/atla-mcp-server
git clone https://github.com/yourusername/atla-mcp-server.git
cd atla-mcp-server
pwd
# /path/to/atla-mcp-server
- 安装
uv在您的系统中/path/to/uv如果你还没有,你可以找到说明 这里例如在MacOS上:
brew install uv
which uv
# /path/to/uv
- 将需求安装到虚拟环境中
/path/to/atla-mcp-server
uv venv
uv sync
- 添加您的
ATLA_API_KEY进入你的环境-你可以找到你的 这里例如在MacOS上:
export ATLA_API_KEY=<your-atla-api-key> >> ~/.zshrc
source ~/.zshrc
echo $ATLA_API_KEY
# <your-atla-api-key>
- 如果你正在使用OpenAI代理进行构建,你还需要一个
OPENAI_API_KEY在您的环境中
用法
与OpenAI代理SDK一起使用
atla mcp服务器可以与 OpenAI代理SDK 如下:
from agents import Agent
from agents.mcp import MCPServerStdio
import os
atla_api_key = os.environ.get("ATLA_API_KEY", "<your_atla_api_key>") # You can also manually set your ATLA_API_KEY here
async with MCPServerStdio(
params={
"command": "python",
"args": ["/path/to/atla-mcp-server/atla-mcp-server.py"],
"env": {"ATLA_API_KEY":atla_api_key}
}
) as atla_mcp_server:
# Create an agent with the Atla evaluation server
agent = Agent(
name="AssistantWithAtlaEval",
instructions="""
You are a helpful assistant. Your goal is to provide high-quality responses to user requests.
You can use the Atla evaluation tool to improve your responses.
""",
mcp_servers=[atla_mcp_server], # You can equip any Agent with Atla's MCP server like this
model="gpt-4o-mini"
)
例如,从运行以下命令 /path/to/atla-mcp-server:
uv run examples/agent_with_atla_eval.py "Write a one-line poem about the ocean. Evaluate it with atla for cliche and improve it once using the feedback."
您还可以在中尝试此示例的笔记本版本 examples/agent_notebook.ipynb.
与Claude Desktop一起使用
- 从下载克劳德桌面 这里 (这是一个本地服务器,无法在web上与claude.ai一起使用)
- 点击克劳德→ 设置…→ 开发者→ 编辑配置
- 将以下内容添加到
claude_desktop_config.json文件(确保替换<your-atla-api-key>使用您的实际Atla API密钥):
{
"mcpServers": {
"atla-mcp-server": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/atla-mcp-server",
"run",
"atla-mcp-server.py"
],
"env": {
"ATLA_API_KEY": "<your-atla-api-key>"
}
}
}
}
- 重新启动Claude Desktop时,您应该看到
atla-mcp-server在可用MCP服务器列表中,有5个工具可供Claude使用。 - 示例提示克劳德:
Write a poem, evaluate it with atla for helpfulness
与光标一起使用
- 将以下内容添加到您的
.cursor/mcp.json:
{
"mcpServers": {
"atla-mcp-server": {
"command": "/path/to/uv",
"args": [
"--directory",
"/path/to/atla-mcp-server",
"run",
"atla-mcp-server.py"
],
"env": {
"ATLA_API_KEY": "<your-atla-api-key>"
}
}
}
}