Agent.ai MCP 服务器集成于 Agent.ai API,借助动态函数加载系统,提供网页文本提取、网页截图以及 YouTube 字幕获取等实用功能,为用户带来高效便捷的服务体验。
使用此 MCP 服务器,您需要一个 Agent.ai API 令牌。请联系 Agent.ai 获取您的专属令牌。
在 claude_desktop_config.json 中添加以下内容:
{
"mcpServers": {
"agentai": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"API_TOKEN",
"mcp/agentai"
],
"env": {
"API_TOKEN": "YOUR_API_TOKEN_HERE"
}
}
}
}
{
"mcpServers": {
"agentai": {
"command": "npx",
"args": [
"-y",
"@agentai/mcp-server"
],
"env": {
"API_TOKEN": "YOUR_API_TOKEN_HERE"
}
}
}
}
该服务器可动态加载来自 Agent.ai API 的工具,当前可用工具如下:
| 工具名称 | 功能 | 输入参数 |
|---|---|---|
grab_web_text |
提取网页文本内容 | url (字符串,必需):要提取的网页 URL;mode (字符串,可选):"抓取" 单个页面,"爬取" 最多 100 页 |
grab_web_screenshot |
捕获网页页面的视觉截图 | url (字符串,必需):要捕获的网页 URL;ttl_for_screenshot (整数,可选):截图缓存过期时间(秒) |
get_youtube_transcript |
获取 YouTube 视频的字幕 | url (字符串,必需):YouTube 视频 URL |
更多工具请访问 API 参考文档。
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ' , 'Content-Type': 'application/json'},
body: '{"url":"https://agent.ai","mode":"抓取"}'
};
fetch('https://api-lr.agent.ai/api/v1/grab_web_text', options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ' , 'Content-Type': 'application/json'},
body: '{"url":"https://agent.ai","mode":"爬取"}'
};
fetch('https://api-lr.agent.ai/api/v1/grab_web_screenshot', options)
.then(response => response.blob())
.then(blob => {
const img = document.createElement('img');
img.src = URL.createObjectURL(blob);
document.body.appendChild(img);
})
.catch(error => console.error('Error:', error));
const options = {
method: 'POST',
headers: {Authorization: 'Bearer ' , 'Content-Type': 'application/json'},
body: '{"url":"https://www.youtube.com/watch?v=VIDEO_ID"}'
};
fetch('https://api-lr.agent.ai/api/v1/get_youtube_transcript', options)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
docker build -t mcp/agentai .
本软件根据 [许可证名称] 许可,具体内容请参阅 [LICENSE 文件路径]。