昴星团
统一的MCP编排器,通过单个端点将AI代理连接到多个提供者(Linear、Sentry等)。
快速开始
bun installimport Pleiades from './src/main.js';
import type { PleiadesConfig } from './src/types.js';
// Configure providers
const config: PleiadesConfig = {
name: 'pleiades', //this becomes the `use_pleiades` tool
baseUrl: 'http://localhost:8787',
providers: [
{
id: 'sentry',
mcpUrl: 'https://mcp.sentry.dev/mcp',
oauth: {
authUrl: 'https://mcp.sentry.dev/oauth/authorize',
tokenUrl: 'https://mcp.sentry.dev/oauth/token',
clientId: process.env.SENTRY_CLIENT_ID!,
clientSecret: process.env.SENTRY_CLIENT_SECRET!,
scopes: ['org:read', 'project:write']
}
},
{
id: 'linear',
mcpUrl: 'https://mcp.linear.app/mcp',
oauth: {
authUrl: 'https://linear.app/oauth/authorize',
tokenUrl: 'https://api.linear.app/oauth/token',
clientId: process.env.LINEAR_CLIENT_ID!,
clientSecret: process.env.LINEAR_CLIENT_SECRET!,
scopes: ['read', 'write']
}
},
...
],
store: yourTokenStore // Implement TokenStore interface
};
// Create instance
const pleiades = new Pleiades(config);
// Serve
Bun.serve({
port: 8787,
fetch: pleiades.fetch
});配置
提供商类型:
- OAuth:提供
oauth需要身份验证的提供程序的配置 - API代币:使用
apiToken用于简单的基于令牌的身份验证
TokenStore接口:
interface TokenStore {
getToken(tenantId: string, providerId: string, accountId?: string): Promise;
setToken(tenantId: string, providerId: string, accountId: string, token: Token): Promise;
revokeToken(tenantId: string, providerId: string, accountId: string): Promise;
getAccounts(tenantId: string, providerId: string): Promise;
}端点
GET /mcp-人工智能代理的MCP端点GET /oauth/callback-OAuth回调处理程序- 每个提供者都将工具公开为
use_{providerId}
在本地运行
bun run dev部署
目前支持Cloudflare Workers。OAuth需要一个数据库来存储令牌。
