mcpField
A
AI Tool Discovery Agent

AI Tool Discovery Agent

本地服务
github.com/nirholas开发工具323 周前更新

关于 AI Tool Discovery Agent

Lyra Tool Discovery 是一个面向加密货币、DeFi 与 web3 生态的 AI 驱动工具发现命令行工具。它从 GitHub 和 npm 搜索 MCP 服务及相关 API,并由 AI 分析后生成插件配置。适合需要快速评估和接入新工具的开发者与插件市场运营者。

主要功能

  1. 01从 GitHub 与 npm 搜索候选工具
  2. 02按加密相关关键词与更新时间过滤
  3. 03支持 OpenAI 与 Anthropic 模型分析
  4. 04生成 8 种插件模板的配置
  5. 05提供命令行、TypeScript SDK 与 JSON 输出

适用场景

  1. 01为 DeFi 应用批量发现并评估 MCP 服务
  2. 02在 CI/CD 流水线中以 JSON 输出导入工具清单
  3. 03使用 dry-run 模式预览待分析的候选工具

MCP 相关

该工具用于发现并生成 MCP 服务的接入配置,其中 mcp-http 与 mcp-stdio 模板分别对应远程与本地 MCP 服务。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

暂未收录安装方式

我们还没有获取到这个服务的安装包或远程地址,请按项目 README 中的说明安装。

代码仓库

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

🔮 Lyra 工具发现

面向 MCP 生态系统的 AI 驱动工具发现

TypeScript PRs Welcome AI Powered

文档 · CLI 参考 · 示例 · 贡献


📖 概述

Lyra Tool Discovery 是一款 AI 驱动的自动化工具,专为 加密货币、DeFi、区块链和 Web3 生态系统打造。它解决了在面向加密货币的应用中手动发现、评估和集成 MCP(模型上下文协议)服务这一棘手问题。无需再花数小时搜索 GitHub、阅读 README 并摸索合适的集成方式,Lyra 只需几秒即可为你完成这些工作。

该工具会从多个来源(GitHub 和 npm)抓取数据,查找与加密货币相关的 MCP 服务、API 和插件。它会筛选结果,仅关注区块链、DeFi、Web3 和加密货币工具(包括 Ethereum、Solana、Bitcoin、钱包、代币、NFT、DEX、质押、跨链桥等)。随后,Lyra 会利用先进的 AI(OpenAI GPT-4o 或 Anthropic Claude)分析发现的每个工具,并自动生成可直接使用的插件配置。

🪙 加密货币领域

Lyra 针对以下相关工具的发现进行了优化:

  • 区块链网络 — Ethereum、Solana、Bitcoin、Layer 2、跨链桥
  • DeFi 协议 — DEX、借贷、质押、收益耕作、流动性
  • Web3 基础设施 — 钱包、RPC 提供商、索引器、预言机
  • 代币标准 — ERC-20、ERC-721、NFT、代币兑换
  • 智能合约 — 开发、审计、部署工具
  • 链上数据 — 分析、区块浏览器、交易追踪

Lyra 面向需要快速接入新工具的加密货币 MCP 生态系统开发者、负责整理加密货币插件的 plugin.delivery 等插件市场运营者,以及构建用于发现和部署 DeFi 工具的 CI/CD 流水线的自动化工程师。

该工具是从发现到部署流程中的关键一环:lyra-tool-discovery → github-to-mcp → plugin.delivery → SperaxOS 用户。通过自动化发现和分类阶段,Lyra 能以最少的人工干预实现全自动插件接入。


✨ 功能

🤖 多提供商 AI
  • OpenAI — GPT-4o、GPT-4-turbo、GPT-3.5-turbo
  • Anthropic — Claude Sonnet 4、Claude Opus
  • 自动检测环境变量
  • 通过 CLI 或配置自定义模型选择
  • 在不同提供商之间智能回退
📦 8 种插件模板
  • mcp-http — 远程 MCP 服务(HTTP/SSE)
  • mcp-stdio — 本地 MCP 服务(stdio)
  • openapi — REST API 集成
  • standalone — 完整的 React 应用
  • markdown — 富文本/文档
  • default — 可配置插件
  • settings — 用户偏好设置插件
  • basic — 简单函数插件
🔍 发现来源
  • GitHub — 搜索仓库、主题和 README
  • npm — 搜索包注册表
  • 🔜 Smithery(MCP 目录)
  • 🔜 OpenAPI Directory
  • 🔜 RapidAPI
### 🪙 加密货币筛选
  • 关键词 — crypto、defi、blockchain、web3

  • 网络 — ethereum、solana、bitcoin

  • 协议 — wallet、token、nft、dex、staking

  • 时间筛选 — 仅包含 12 个月内更新的仓库

  • 智能验证 — AI 验证加密货币相关性

  • 功能齐全的命令行界面

  • 用于自动化的 Node.js/TypeScript SDK

  • 为 CI/CD 流水线提供 JSON 输出

  • 用于测试的试运行模式

  • 进度指示器和丰富的输出

🖥️ CLI 与编程 API
  • 功能齐全的命令行界面
  • 用于自动化的 Node.js/TypeScript SDK
  • 为 CI/CD 流水线提供 JSON 输出
  • 用于测试的试运行模式
  • 进度指示器和丰富的输出
🧪 测试与验证
  • 使用 --dry-run 模式安全测试
  • 无需调用 AI 即可列出发现的工具
  • 在部署前验证配置
  • 用于故障排查的调试日志
📤 灵活的输出
  • 结构化 JSON,可传递给其他工具
  • 适用于 SperaxOS 的快速导入格式
  • 适用于 plugin.delivery 的插件清单
  • 带有丰富格式的控制台输出

🪙 加密货币发现关键词

Lyra 会自动筛选发现结果,重点关注加密货币/DeFi/blockchain/web3 工具。以下关键词用于搜索查询和结果验证:

查看所有支持的关键词
类别关键词
通用crypto、cryptocurrency、defi、blockchain、web3
网络ethereum、eth、solana、sol、bitcoin、btc、chain
代币token、erc20、erc721、nft
DeFidex、swap、staking、yield、lending、liquidity、vault、bridge
基础设施wallet、protocol、onchain、on-chain、smart contract
库web3.js、ethers、viem、wagmi、rainbowkit
协议uniswap、aave、compound

不匹配上述任何关键词的工具会被自动筛除,确保你只发现与加密货币相关的 MCP 服务。

按时间筛选

默认情况下,Lyra 仅发现过去 12 个月内更新过的工具。这能确保你找到仍在积极维护的项目。使用 --max-age 可调整:

# Only tools updated in the last 6 months
lyra-discover discover --max-age 6

# Only tools updated in the last 3 months (bleeding edge)
lyra-discover discover --max-age 3

# Tools up to 24 months old
lyra-discover discover --max-age 24

快速开始

安装
# Global install (recommended for CLI usage)
pnpm add -g @nirholas/lyra-tool-discovery

# Or with npm
npm install -g @nirholas/lyra-tool-discovery

# Or as a project dependency
pnpm add @nirholas/lyra-tool-discovery

# Or run directly with npx (no install)
npx @nirholas/lyra-tool-discovery discover --help
环境设置
# Using OpenAI (default when both keys present)
export OPENAI_API_KEY="sk-..."

# Or using Anthropic
export ANTHROPIC_API_KEY="sk-ant-..."

# Optional: Force a specific provider
export AI_PROVIDER="anthropic"  # or "openai"

# Optional: Specify a model
export AI_MODEL="claude-sonnet-4-20250514"

# Optional: GitHub token for higher rate limits
export GITHUB_TOKEN="ghp_..."
首次发现
# Discover MCP servers from GitHub and npm
lyra-discover discover --sources github,npm --limit 10

# Run in dry-run mode (no AI calls)
lyra-discover discover --dry-run --limit 20

# Analyze a specific GitHub repository
lyra-discover analyze-repo anthropics claude-mcp

# Analyze an npm package
lyra-discover analyze-npm @modelcontextprotocol/server-github

# Check available AI providers
lyra-discover providers

# View all plugin templates
lyra-discover templates

📖 CLI 参考

全局选项
标志别名描述默认值
--provider-pAI 提供商(openai 或 anthropic)从环境变量自动检测
--model-m使用的 AI 模型提供商默认值
--version-V显示版本号—
--help-h显示帮助—
命令
discover

在已配置的来源中搜索 MCP 工具和 API。

lyra-discover discover [options]
选项别名描述默认值
--sources-s逗号分隔的来源:github、npm、awesome-listgithub,npm
--limit-l每个来源最多发现的工具数5
--max-age-a发现的仓库的最大时间(月)12
--dry-run-d列出工具,不进行 AI 分析false
--provider-p要使用的 AI 提供商自动检测
--model-m要使用的 AI 模型提供商默认值

示例:

# Discover crypto MCP tools from GitHub only, limit 10 results
lyra-discover discover --sources github --limit 10

# Find tools updated in the last 6 months only
lyra-discover discover --max-age 6 --limit 20

# Dry run to preview what would be analyzed
lyra-discover discover --dry-run --sources npm --limit 20

# Use Anthropic Claude for analysis
lyra-discover discover --provider anthropic --model claude-sonnet-4-20250514

# Use OpenAI GPT-4o for analysis
lyra-discover discover --provider openai --model gpt-4o

输出示例:

🔍 Discovering crypto/DeFi/web3 tools from: github, npm
📅 Max age: 12 months
  Found 5 from github
  Found 3 from npm

📊 Total discovered: 8 tools
🪙 Crypto-related: 6 tools
🔌 MCP-compatible: 5 tools

🤖 Analyzing: mcp-server-ethereum...
  Template: mcp-stdio
  Reasoning: Has MCP SDK dependency and bin entry for local execution

✅ Analyzed 5 tools

📦 Generated Configs:

--- mcp-server-ethereum ---
Template: mcp-stdio
Config: {
  "identifier": "mcp-server-ethereum",
  "customParams": {
    "mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mcp-server-ethereum"]
    }
  }
}

analyze-repo

分析指定的 GitHub 仓库。

lyra-discover analyze-repo <owner> <repo> [options]
参数描述
ownerGitHub 仓库所有者/组织
repo仓库名称
选项别名描述
--provider-p要使用的 AI 提供商
--model-m要使用的 AI 模型

示例:

# Analyze the official MCP GitHub server
lyra-discover analyze-repo modelcontextprotocol servers

# Analyze with specific model
lyra-discover analyze-repo anthropics claude-mcp --model gpt-4o

# Analyze a community MCP server
lyra-discover analyze-repo punkpeye mcp-server-obsidian

输出示例:

🔍 Fetching modelcontextprotocol/servers...
🤖 Analyzing...

✅ Analysis complete:
  Template: mcp-stdio
  Reasoning: Repository contains multiple MCP servers with bin entries, using @modelcontextprotocol/sdk

📋 Quick Import JSON:
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"]
    }
  }
}

analyze-npm

分析指定的 npm 包。

lyra-discover analyze-npm <package> [options]
参数描述
packagenpm 包名称(可带或不带作用域)
选项别名描述
--provider-p要使用的 AI 提供商
--model-m要使用的 AI 模型

示例:

# Analyze official MCP server packages
lyra-discover analyze-npm @modelcontextprotocol/server-github
lyra-discover analyze-npm @modelcontextprotocol/server-filesystem
lyra-discover analyze-npm @modelcontextprotocol/server-slack

# Analyze community packages
lyra-discover analyze-npm mcp-server-sqlite

providers

根据已配置的环境变量显示可用的 AI 提供商。

lyra-discover providers

输出示例(已配置密钥):

🤖 AI Provider Configuration

Available providers (based on env vars):
  ✅ openai
  ✅ anthropic

Override with env vars or CLI flags:
  AI_PROVIDER=openai|anthropic
  AI_MODEL=gpt-4o|claude-sonnet-4-20250514|etc.
  --provider openai --model gpt-4o

输出示例(未配置密钥):

🤖 AI Provider Configuration

Available providers (based on env vars):
  ⚠️  No API keys found!

Set one of these environment variables:
  - OPENAI_API_KEY     → Use OpenAI (gpt-4o, gpt-4-turbo, etc.)
  - ANTHROPIC_API_KEY  → Use Anthropic (claude-sonnet-4-20250514, etc.)

templates

显示所有可用的插件模板及其描述。

lyra-discover templates

输出:

╔═══════════════════════════════════════════════════════════════════════════════╗
║                     plugin.delivery Plugin Templates                          ║
╠════════════╦════════════╦═══════════════════════════════════════════════════════╣
║ Template   ║ Type       ║ Description                   ║ Use Case           ║
╠════════════╬════════════╬═══════════════════════════════╬════════════════════╣
║ basic      ║ Default    ║ Standard plugin with API      ║ Simple data lookups║
║ default    ║ Default    ║ Plugin with settings UI       ║ Configurable tools ║
║ markdown   ║ Markdown   ║ Rich text output              ║ Formatted reports  ║
║ openapi    ║ OpenAPI    ║ Auto-generated from spec      ║ Existing APIs      ║
║ settings   ║ Default    ║ Plugin with user preferences  ║ Personalized tools ║
║ standalone ║ Standalone ║ Full React application        ║ Interactive UIs    ║
╠════════════╬════════════╬═══════════════════════════════╬════════════════════╣
║ mcp-http   ║ MCP        ║ Streamable HTTP MCP server    ║ Remote MCP tools   ║
║ mcp-stdio  ║ MCP        ║ STDIO-based MCP server        ║ Local npm MCP      ║
╚════════════╩════════════╩═══════════════════════════════╩════════════════════╝

🔧 编程 API

在 Node.js/TypeScript 项目中将 Lyra 用作库:

import { 
  ToolDiscovery, 
  GitHubSource, 
  NpmSource,
  AIAnalyzer 
} from '@nirholas/lyra-tool-discovery';

// Initialize with default settings (auto-detect AI provider)
const discovery = new ToolDiscovery();

// Or with specific configuration
const discovery = new ToolDiscovery({
  provider: 'anthropic',
  model: 'claude-sonnet-4-20250514',
  apiKey: process.env.ANTHROPIC_API_KEY // Optional, uses env var by default
});

// Discover from all sources
const results = await discovery.discover({
  sources: ['github', 'npm'],
  limit: 20,
  dryRun: false
});

// Process results
for (const result of results) {
  console.log(`Tool: ${result.tool.name}`);
  console.log(`Template: ${result.decision.template}`);
  console.log(`Config:`, result.generated.pluginConfig);
}

// Analyze a specific GitHub repo
const repoResult = await discovery.analyzeGitHubRepo('owner', 'repo');
console.log(repoResult?.decision.template);

// Analyze a specific npm package
const npmResult = await discovery.analyzeNpmPackage('@scope/package-name');
console.log(npmResult?.decision.template);
使用单个组件
import { GitHubSource, NpmSource, AIAnalyzer } from '@nirholas/lyra-tool-discovery';

// Use GitHub source directly
const github = new GitHubSource(process.env.GITHUB_TOKEN);
const mcpTools = await github.searchMCPServers(10);
const openApiTools = await github.searchOpenAPISpecs(10);
const specificRepo = await github.getRepo('owner', 'repo');

// Use npm source directly
const npm = new NpmSource();
const npmTools = await npm.searchMCPServers(10);
const specificPackage = await npm.getPackageAsTool('@modelcontextprotocol/server-github');

// Use AI analyzer directly
const ai = new AIAnalyzer({ provider: 'openai', model: 'gpt-4o' });
const decision = await ai.analyzeAndDecide(discoveredTool);
const quickImport = ai.generateQuickImport(decision);
类型定义
import type {
  // Discovery types
  DiscoveredTool,
  DiscoveryResult,
  DiscoverySource,
  
  // Template types
  PluginTemplate,
  TemplateDecision,
  
  // MCP types
  MCPConnection,
  MCPHttpConnection,
  MCPStdioConnection,
  MCPAuthConfig,
  
  // Plugin types
  CustomPlugin,
  PluginManifest,
  PluginIndexEntry,
  MCPQuickImportConfig
} from '@nirholas/lyra-tool-discovery';

🏗️ 架构

┌─────────────────────────────────────────────────────────────────────────────┐
│                          LYRA TOOL DISCOVERY                                │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                             │
│  ┌────────────────┐     ┌────────────────┐     ┌────────────────────────┐  │
│  │    Sources     │     │  AI Analyzer   │     │   Template Engine      │  │
│  ├────────────────┤     ├────────────────┤     ├────────────────────────┤  │
│  │                │     │                │     │                        │  │
│  │ • GitHub API   │────▶│ • OpenAI       │────▶│ • basic                │  │
│  │   - Repos      │     │   - GPT-4o     │     │ • default              │  │
│  │   - Topics     │     │   - GPT-4-turbo│     │ • markdown             │  │
│  │   - READMEs    │     │                │     │ • openapi              │  │
│  │                │     │ • Anthropic    │     │ • settings             │  │
│  │ • npm Registry │     │   - Claude     │     │ • standalone           │  │
│  │   - Packages   │     │   - Sonnet     │     │ • mcp-http             │  │
│  │   - Keywords   │     │   - Opus       │     │ • mcp-stdio            │  │
│  │                │     │                │     │                        │  │
│  └────────────────┘     └────────────────┘     └────────────────────────┘  │
│          │                      │                         │                │
│          │                      │                         │                │
│          ▼                      ▼                         ▼                │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │                         Discovery Result                            │   │
│  ├─────────────────────────────────────────────────────────────────────┤   │
│  │  {                                                                  │   │
│  │    tool: DiscoveredTool,     // Source metadata                     │   │
│  │    decision: TemplateDecision, // AI analysis result                │   │
│  │    generated: {                                                     │   │
│  │      pluginConfig: CustomPlugin | PluginIndexEntry                  │   │
│  │    }                                                                │   │
│  │  }                                                                  │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                    │                                       │
│                                    ▼                                       │
│                    ┌───────────────────────────────┐                       │
│                    │        Output Formats         │                       │
│                    ├───────────────────────────────┤                       │
│                    │ • JSON (for pipelines)        │                       │
│                    │ • Quick Import (SperaxOS)     │                       │
│                    │ • Plugin Manifests            │                       │
│                    │ • Console (human-readable)    │                       │
│                    └───────────────────────────────┘                       │
└─────────────────────────────────────────────────────────────────────────────┘

📋 插件模板

Lyra 会分析工具,并自动从 8 种插件模板中进行选择:

模板传输方式类型使用场景AI 选择标准
mcp-httpHTTP/SSEMCP远程 MCP 服务使用 MCP SDK 和 HTTP 服务端代码,且具有可公开访问的 URL
mcp-stdiostdioMCP本地 MCP 服务使用 MCP SDK,且 package.json 中有 bin 入口,通过 npx 运行
openapiHTTPOpenAPIREST API 集成有 OpenAPI/Swagger 规范文件或文档
standalone—Standalone交互式应用需要复杂 UI、React 组件、数据可视化
markdown—Markdown文档/内容输出格式化文本、报告、文档
default—Default可配置插件需要设置 UI、配置选项
settings—Default用户偏好设置存储用户偏好设置、个性化信息
basic—Default简单函数简单的数据查询、基础 API 调用
AI 决策优先级

AI 选择模板时遵循以下优先级:

  1. MCP 检测 → 如果工具使用 @modelcontextprotocol/sdk:
    • 有 HTTP 服务端 → mcp-http
    • 有 bin 入口 → mcp-stdio
  2. OpenAPI 检测 → 如果有 openapi.json/yaml 或 Swagger 规范 → openapi
  3. 复杂 UI → 如果需要交互式仪表板 → standalone
  4. 格式化输出 → 如果输出丰富文本/Markdown → markdown
  5. 配置 → 如果需要用户设置 → default 或 settings
  6. 默认 → 简单函数 → basic

🔗 集成流水线

Lyra Tool Discovery 是 SperaxOS 生态系统中更大型自动化工具链的一部分:

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│                 │     │                 │     │                 │     │                 │
│  lyra-discover  │────▶│  github-to-mcp  │────▶│ plugin.delivery │────▶│    SperaxOS     │
│                 │     │                 │     │                 │     │                 │
│  Discovery &    │     │   Conversion    │     │   Marketplace   │     │   End Users     │
│   Analysis      │     │                 │     │                 │     │                 │
└─────────────────┘     └─────────────────┘     └─────────────────┘     └─────────────────┘
  1. 发现(本工具)— 在 GitHub/npm 上查找工具,使用 AI 进行分析并生成配置
  2. 转换 — github-to-mcp 将代码仓库转换为 MCP 服务
  3. 注册 — plugin.delivery 托管插件市场
  4. 使用 — SperaxOS 用户发现并安装插件
自动化 PR 工作流

你可以设置 GitHub Action 来自动完成整个流水线:

# .github/workflows/discover-tools.yml
name: Discover New Tools

on:
  schedule:
    - cron: '0 0 * * *'  # Daily at midnight
  workflow_dispatch:

jobs:
  discover:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'
      
      - name: Install Lyra
        run: npm install -g @nirholas/lyra-tool-discovery
      
      - name: Discover new MCP servers
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          lyra-discover discover \
            --sources github,npm \
            --limit 50 \
            > discovered-tools.json
      
      - name: Create PR with new tools
        uses: peter-evans/create-pull-request@v5
        with:
          title: '🔮 New tools discovered by Lyra'
          body: 'Automated discovery run found new MCP servers and APIs.'
          branch: lyra/discovered-tools

⚙️ 配置

环境变量
变量描述示例
OPENAI_API_KEYOpenAI API 密钥sk-...
ANTHROPIC_API_KEYAnthropic API 密钥sk-ant-...
AI_PROVIDER强制指定提供商openai 或 anthropic
AI_MODEL覆盖默认模型gpt-4o、claude-sonnet-4-20250514
GITHUB_TOKEN用于提高速率限制的 GitHub 令牌ghp_...
配置文件(即将推出)

支持 discovery.config.json:

{
  "sources": {
    "github": {
      "enabled": true,
      "searchQueries": [
        "mcp server in:name,description",
        "modelcontextprotocol in:readme",
        "@modelcontextprotocol in:readme"
      ],
      "minStars": 10
    },
    "npm": {
      "enabled": true,
      "keywords": ["mcp", "model-context-protocol", "mcp-server"],
      "scopes": ["@modelcontextprotocol"]
    }
  },
  "ai": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-20250514",
    "maxTokens": 4096
  },
  "output": {
    "format": "json",
    "path": "./data/discovered-tools.json",
    "includeMetadata": true
  },
  "filters": {
    "requireMCPSupport": true,
    "requireLicense": true,
    "excludeArchived": true
  }
}

📚 示例

示例 1:发现并保存结果
# Discover tools and save to file
lyra-discover discover --sources github,npm --limit 20 > tools.json

# Parse with jq
cat tools.json | jq '.[] | {name: .tool.name, template: .decision.template}'
示例 2:批量分析代码仓库
# Create a list of repos to analyze
repos=(
  "modelcontextprotocol/servers"
  "anthropics/claude-mcp"
  "punkpeye/mcp-server-obsidian"
)

# Analyze each repo
for repo in "${repos[@]}"; do
  owner=$(echo $repo | cut -d'/' -f1)
  name=$(echo $repo | cut -d'/' -f2)
  lyra-discover analyze-repo $owner $name
  echo "---"
done
示例 3:在 CI 中分析 npm 包
// scripts/analyze-packages.ts
import { ToolDiscovery } from '@nirholas/lyra-tool-discovery';

const packages = [
  '@modelcontextprotocol/server-github',
  '@modelcontextprotocol/server-filesystem',
  '@modelcontextprotocol/server-slack',
];

async function main() {
  const discovery = new ToolDiscovery({ provider: 'openai' });
  
  for (const pkg of packages) {
    const result = await discovery.analyzeNpmPackage(pkg);
    if (result) {
      console.log(JSON.stringify({
        package: pkg,
        template: result.decision.template,
        config: result.generated.pluginConfig
      }, null, 2));
    }
  }
}

main();
示例 4:集成自定义来源
import { AIAnalyzer, type DiscoveredTool } from '@nirholas/lyra-tool-discovery';

// Create a custom discovered tool
const customTool: DiscoveredTool = {
  id: 'custom:my-tool',
  name: 'my-custom-mcp-server',
  description: 'A custom MCP server for my application',
  source: 'github',
  sourceUrl: 'https://github.com/myorg/my-tool',
  hasMCPSupport: true,
  hasNpmPackage: true,
  readme: '# My Tool\n\nAn MCP server that does X, Y, Z...',
  packageJson: {
    name: 'my-custom-mcp-server',
    bin: { 'my-mcp': './dist/cli.js' },
    dependencies: { '@modelcontextprotocol/sdk': '^1.0.0' }
  }
};

// Analyze with AI
const ai = new AIAnalyzer({ provider: 'anthropic' });
const decision = await ai.analyzeAndDecide(customTool);
console.log(`Template: ${decision.template}`);
console.log(`Reasoning: ${decision.reasoning}`);
示例 5:使用筛选条件进行试运行
# Discover in dry-run mode to see what would be analyzed
lyra-discover discover --dry-run --sources github --limit 50

# Output:
# [DRY RUN] Would analyze: mcp-server-github
#   Source: github
#   URL: https://github.com/modelcontextprotocol/servers
#   MCP: Yes
# [DRY RUN] Would analyze: claude-mcp
#   Source: github
#   URL: https://github.com/anthropics/claude-mcp
#   MCP: Yes
# ...
示例 6:为 SperaxOS 生成快速导入
import { ToolDiscovery } from '@nirholas/lyra-tool-discovery';

const discovery = new ToolDiscovery();
const result = await discovery.analyzeNpmPackage('@modelcontextprotocol/server-github');

// The quick import format can be directly pasted into SperaxOS
console.log(`Add this to your MCP configuration:`);
console.log(JSON.stringify({
  mcpServers: {
    [result.tool.name]: result.decision.config.customParams?.mcp
  }
}, null, 2));

🤝 参与贡献

欢迎贡献!以下是入门方法:

开发环境设置
# Clone the repository
git clone https://github.com/nirholas/lyra-tool-discovery.git
cd lyra-tool-discovery

# Install dependencies
pnpm install

# Set up environment
cp .env.example .env
# Edit .env with your API keys

# Run in development mode
pnpm dev discover --dry-run

# Build
pnpm build

# Run tests
pnpm test
代码风格
  • 使用严格模式的 TypeScript
  • 使用 ESLint 检查代码
  • 使用 Prettier 格式化代码
  • 为公共 API 编写 JSDoc 注释
  • 提交信息遵循 conventional commits 规范
Pull Request 流程
  1. Fork 仓库
  2. 创建功能分支:git checkout -b feature/amazing-feature
  3. 进行修改
  4. 视情况添加测试
  5. 运行 pnpm build 和 pnpm test
  6. 使用符合 conventional commit 规范的信息提交:feat: add amazing feature
  7. 推送到你的 fork:git push origin feature/amazing-feature
  8. 发起 Pull Request
可贡献的领域
  • 🔌 新数据源 — 添加对 Smithery、OpenAPI Directory、RapidAPI 的支持
  • 🤖 AI 提供商 — 添加对 Gemini、Mistral、本地模型的支持
  • 📝 文档 — 改进示例,添加教程
  • 🧪 测试 — 添加单元测试、集成测试
  • 🐛 错误修复 — 查看问题标签页

🔗 相关项目

项目描述
github-to-mcp将 GitHub 仓库转换为 MCP 服务
plugin.deliverySperaxOS 的插件市场
SperaxOSAI 原生操作系统
lyra-registry精选的已发现插件注册表
UCAI通用上下文 AI 框架
MCP SDK官方 Model Context Protocol SDK

📄 许可证

MIT License © 2024 nirholas

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

🙏 致谢


文档

完整文档站点:https://nirholas.github.io/lyra-tool-discovery/

  • 快速入门介绍安装和首次运行。
  • 示例提供可直接复制粘贴的代码片段。

Star 历史

Star 历史图表

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。