|
| 1 | +# @mcp-check/agents |
| 2 | + |
| 3 | +Multi-provider AI agent framework for Model Context Protocol (MCP) servers. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +```bash |
| 8 | +npm install @mcp-check/agents |
| 9 | +``` |
| 10 | + |
| 11 | +## Usage |
| 12 | + |
| 13 | +```typescript |
| 14 | +import { client, McpServer } from '@mcp-check/agents'; |
| 15 | + |
| 16 | +// Create an MCP server configuration |
| 17 | +const mcpServer = new McpServer({ |
| 18 | + url: 'your-mcp-server-url', |
| 19 | + authorizationToken: 'your-auth-token', |
| 20 | + name: 'your-server-name', |
| 21 | + type: 'your-server-type' |
| 22 | +}); |
| 23 | + |
| 24 | +// Initialize client with models |
| 25 | +const agents = client(mcpServer, ['claude-3-haiku-20240307', 'gpt-4']); |
| 26 | + |
| 27 | +// Execute with prompt |
| 28 | +const result = await agents |
| 29 | + .prompt('Your prompt here') |
| 30 | + .allowTools(['tool1', 'tool2']) |
| 31 | + .execute(); |
| 32 | + |
| 33 | +console.log(result.usedTools); |
| 34 | +``` |
| 35 | + |
| 36 | +## API |
| 37 | + |
| 38 | +### `McpServer` |
| 39 | + |
| 40 | +Configuration class for MCP server connection. |
| 41 | + |
| 42 | +#### Constructor |
| 43 | + |
| 44 | +```typescript |
| 45 | +new McpServer({ |
| 46 | + url: string; |
| 47 | + authorizationToken: string; |
| 48 | + name: string; |
| 49 | + type: string; |
| 50 | +}) |
| 51 | +``` |
| 52 | + |
| 53 | +### `client(mcpServer, models)` |
| 54 | + |
| 55 | +Creates an `Agents` instance. |
| 56 | + |
| 57 | +- `mcpServer`: McpServer instance |
| 58 | +- `models`: Array of AI model identifiers |
| 59 | + |
| 60 | +### `Agents` |
| 61 | + |
| 62 | +Main agent execution class. |
| 63 | + |
| 64 | +#### Methods |
| 65 | + |
| 66 | +- `prompt(text: string)`: Set the prompt text |
| 67 | +- `allowTools(tools: string[])`: Specify allowed tools |
| 68 | +- `execute()`: Execute the agent with configured models |
| 69 | + |
| 70 | +## Supported Models |
| 71 | + |
| 72 | +- Anthropic models (Claude) |
| 73 | +- OpenAI models (GPT) |
| 74 | + |
| 75 | +## License |
| 76 | + |
| 77 | +MIT |
0 commit comments