提供针对代理优化的Lens Protocol数据和功能访问的模型上下文协议(MCP)服务器。
当你需要在Lens Protocol中查找或发现任何内容时
lens_search(query="vitalik", type="accounts", show="concise")当你想要了解关于Lens Protocol账户的所有信息时
basic,social,influence,activity(包括帖子),networklens_profile(who="0x...", include=["basic", "activity"], analyze="influence")当你想要理解内容的表现以及人们对它的看法时
lens_content(about="reactions", target="post_123", include=["likes", "comments"])当你想要探索更广泛的Lens Protocol生态系统时
lens_ecosystem(view="trending", timeframe="7d", show="detailed")优化用于AI理解的自然语言摘要:
🔍 找到5个与"区块链"匹配的账户:
• vitalik.lens (0x1234...)
• ethereum.lens (0x5678...)
• defi.lens (0x9abc...)
... 还有2个
摘要+完整的JSON数据以供全面上下文:
🔍 找到5个与"区块链"匹配的账户:
• vitalik.lens (0x1234...)
...
{
"items": [...],
"pageInfo": {...}
}
直接的JSON输出用于程序化使用:
{
"items": [...],
"pageInfo": {...}
}
{
"name": "lens_search",
"arguments": {
"query": "vitalik",
"type": "accounts",
"show": "concise",
"limit": 10
}
}
{
"name": "lens_profile",
"arguments": {
"who": "0x...",
"include": ["basic", "activity", "social"],
"show": "detailed"
}
}
{
"name": "lens_content",
"arguments": {
"what": "此帖子的反应",
"about": "reactions",
"target": "post_123",
"include": ["likes", "comments"]
}
}
{
"name": "lens_ecosystem",
"arguments": {
"view": "trending",
"timeframe": "7d",
"show": "detailed"
}
}
bun install
bun start
bun start:http
# 或自定义端口
PORT=8080 bun start:http
该服务器支持stdio(用于本地使用)和HTTP(用于远程访问)传输方式。
设置环境变量:
LENS_ENVIRONMENT:设置为"testnet"用于测试网,默认为主网PORT:HTTP服务器端口(默认:3000)将此服务器添加到你的MCP客户端配置中:
{
"mcpServers": {
"lens-protocol": {
"command": "bun",
"args": ["index.ts"],
"cwd": "/path/to/lens-mcp"
}
}
}
对于远程HTTP访问:
{
"mcpServers": {
"lens-protocol-remote": {
"transport": {
"type": "http",
"url": "https://lens-mcp.wooo.guru/mcp"
}
}
}
}
# stdio模式
bun dev
# HTTP模式
bun dev:http
# 运行单元测试
bun test
# 运行集成测试
bun test:integration
# 运行所有测试
bun test:all
# 使用Docker构建并运行
docker build -f docker/Dockerfile -t lens-mcp .
docker run -p 3000:3000 lens-mcp
# 或使用docker-compose
docker-compose -f docker/docker-compose.yml up
concise,detailed或raw输出bun test.ts进行测试MIT许可证