Anyrxo MCP

MCP运维云端

提供方 anyrxo

运维云端 未标注 无需鉴权 社区 / 第三方

专为Model Context Protocol (MCP)服务器设计的类似Jest的测试框架,提供强大的模拟工具和断言功能。

一句话选型结论

按资料字段整理

Anyrxo MCP 属于运维云端类 MCP 服务器,传输方式未标注,无需鉴权,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类运维云端 传输方式未标注 鉴权无需鉴权 部署方式未标注
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

运维云端
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

适用场景

测试框架TypeScript本地部署MCP服务器单元测试集成测试模拟工具

安装与配置

未标注 无需鉴权
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
云资源查询

查实例、存储、账单等云上资源状态。

部署与发布

把部署、重启、回滚这类操作接进对话。

监控与告警

拉取监控指标,异常时让模型帮你判断。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注无需鉴权,装好就能连。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Anyrxo MCP当前 未标注 未标注 未标注 无 2026-05-17
lobehub 未标注 stdio · 本地进程 本地部署 有 2026-04-11
TrendRadar 未标注 stdio · 本地进程 本地部署 有 2026-04-13
Ui Tars Desktop 8a825770 未标注 stdio · 本地进程 本地部署 有 2026-05-17
ruflo 未标注 stdio · 本地进程 本地部署 有 2026-04-13
FastGPT 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

运维云端
字段来自项目仓库与公开索引,中文说明由本站标注
提供方anyrxo上游标注的维护方 anyrxo
分类运维云端本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式无需鉴权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

12.1 KB
来自项目仓库与上游目录的原文,未做删改

🧪 MCP Test - Testing Framework for Model Context Protocol Servers

> Jest-like testing framework specifically designed for MCP servers

📖 Overview

MCP Test is a comprehensive testing framework for Model Context Protocol (MCP) servers. It provides a familiar Jest-like API with powerful mocking utilities specifically designed for testing MCP tools, resources, and prompts.

Why MCP Test?

While MCP Inspector exists for manual/visual testing, there was no programmatic testing framework for MCP servers. Developers struggled with:

  • ❌ No Jest-like testing library for MCP
  • ❌ Difficulty testing stdio/SSE transports programmatically
  • ❌ No built-in mocking for tools/resources/prompts
  • ❌ Complex setup for integration tests
  • ❌ Limited unit testing capabilities

MCP Test solves all of these problems with a familiar, powerful API.

Key Features

✅ Jest-like API - describe(), test(), expect(), beforeEach()
✅ Powerful Assertions - 20+ matchers including async support
✅ Mock Utilities - Mock tools, resources, prompts with ease
✅ Spy Functions - Track calls, arguments, return values
✅ Async/Await Support - First-class promise testing
✅ Lifecycle Hooks - beforeEach, afterEach, beforeAll, afterAll
✅ Custom Implementations - Full control over mock behavior
✅ Error Handling - Test error conditions easily
✅ Zero Configuration - Works out of the box

🚀 Quick Start

Installation```bash

Clone repository

git clone <repository-url>
cd mcp-test

Install dependencies

npm install

Build TypeScript

npm run build


### Basic Usage

Create a test file `my-server.test.js`:```javascript
import { describe, test, expect, mockTool, createMockServer } from &#x27;mcp-test&#x27;;

describe(&#x27;My MCP Server&#x27;, () =&gt; {
  test(&#x27;read-file tool works&#x27;, async () =&gt; {
    const readFile = mockTool(&#x27;read-file&#x27;, {
      returnValue: { content: &#x27;Hello World&#x27;, size: 11 }
    });

    const result = await readFile.execute({ path: &#x27;/tmp/test.txt&#x27; });

    expect(result.content).toBe(&#x27;Hello World&#x27;);
    expect(readFile).toHaveBeenCalledTimes(1);
    expect(readFile).toHaveBeenCalledWith({ path: &#x27;/tmp/test.txt&#x27; });
  });

  test(&#x27;handles errors gracefully&#x27;, async () =&gt; {
    const failingTool = mockTool(&#x27;failing-tool&#x27;, {
      throwError: &#x27;File not found&#x27;
    });

    await expect(failingTool.execute()).rejects.toThrow(&#x27;File not found&#x27;);
  });
});

Run tests:```bash
node dist/cli.js run my-server.test.js


## 📚 API Reference

### Test Structure

#### `describe(name, fn)`

Group related tests together:```javascript
describe(&#x27;File operations&#x27;, () =&gt; {
  test(&#x27;reads files&#x27;, () =&gt; { /* ... */ });
  test(&#x27;writes files&#x27;, () =&gt; { /* ... */ });
});

test(name, fn) or it(name, fn)

Define a test:```javascript
test('should return correct result', () => {
expect(2 + 2).toBe(4);
});

// Async tests
test('async operation works', async () => {
const result = await asyncFunction();
expect(result).toBe('success');
});


#### `test.skip()` and `test.only()`

Skip or isolate tests:```javascript
test.skip(&#x27;not ready yet&#x27;, () =&gt; {
  // This test will be skipped
});

test.only(&#x27;run only this test&#x27;, () =&gt; {
  // Only this test will run
});

Lifecycle Hooks```javascript

describe('Lifecycle example', () => {
beforeAll(() => {
// Runs once before all tests
});

beforeEach(() => {
// Runs before each test
});

afterEach(() => {
// Runs after each test
});

afterAll(() => {
// Runs once after all tests
});

test('example', () => { / ... / });
});


### Assertions

#### Basic Matchers```javascript
expect(value).toBe(expected);           // Strict equality (===)
expect(value).toEqual(expected);        // Deep equality
expect(value).toBeNull();               // value === null
expect(value).toBeUndefined();          // value === undefined
expect(value).toBeDefined();            // value !== undefined
expect(value).toBeTruthy();             // !!value === true
expect(value).toBeFalsy();              // !!value === false

Negation```javascript

expect(value).not.toBe(unexpected);
expect(value).not.toEqual(unexpected);


#### Collections```javascript
expect([1, 2, 3]).toContain(2);         // Array contains item
expect(&#x27;hello&#x27;).toContain(&#x27;ell&#x27;);       // String contains substring
expect([1, 2, 3]).toHaveLength(3);      // Array/string length

Objects```javascript

expect(obj).toMatchObject({ a: 1, b: 2 }); // Partial object match


#### Errors```javascript
expect(() =&gt; {
  throw new Error(&#x27;boom&#x27;);
}).toThrow();

expect(() =&gt; {
  throw new Error(&#x27;boom&#x27;);
}).toThrow(&#x27;boom&#x27;);

expect(() =&gt; {
  throw new Error(&#x27;boom&#x27;);
}).toThrow(/boom/);

Async/Promises```javascript

// Promise resolves
await expect(promise).resolves.toBe('success');
await expect(promise).resolves.toEqual({ data: 'ok' });

// Promise rejects
await expect(promise).rejects.toThrow('error');
await expect(promise).rejects.toThrow(/error/);


#### Mock Matchers```javascript
expect(mockFn).toHaveBeenCalled();
expect(mockFn).toHaveBeenCalledTimes(3);
expect(mockFn).toHaveBeenCalledWith(arg1, arg2);

Mock Utilities

Create a Mock Tool```javascript

import { mockTool } from 'mcp-test';

const readFile = mockTool('read-file', {
returnValue: { content: 'Hello', size: 5 }
});

// Execute the mock
const result = await readFile.execute({ path: '/tmp/test.txt' });

// Check calls
expect(readFile).toHaveBeenCalled();
expect(readFile.calls).toHaveLength(1);


#### Mock Tool Options```javascript
// Return a value
mockTool(&#x27;tool-name&#x27;, {
  returnValue: { data: &#x27;value&#x27; }
});

// Custom implementation
mockTool(&#x27;tool-name&#x27;, {
  implementation: (params) =&gt; {
    return { result: params.input.toUpperCase() };
  }
});

// Throw an error
mockTool(&#x27;tool-name&#x27;, {
  throwError: &#x27;Something went wrong&#x27;
});

// Or throw a custom error
mockTool(&#x27;tool-name&#x27;, {
  throwError: new TypeError(&#x27;Invalid input&#x27;)
});

Mock Methods```javascript

const tool = mockTool('test-tool');

// Change return value
tool.mockReturnValue('new value');
tool.mockReturnValueOnce('one time value');

// Async values
tool.mockResolvedValue({ data: 'async' });
tool.mockRejectedValue('async error');

// Custom implementation
tool.mockImplementation((params) => {
return { processed: params.data };
});

// Clear call history
tool.mockClear();

// Reset mock (clears + removes implementation)
tool.mockReset();


#### Create Mock Server```javascript
import { createMockServer } from &#x27;mcp-test&#x27;;

const { server, mocks } = createMockServer({
  tools: {
    &#x27;read-file&#x27;: { returnValue: { content: &#x27;test&#x27; } },
    &#x27;write-file&#x27;: { returnValue: { success: true } }
  },
  resources: {
    &#x27;file:///config.json&#x27;: { returnValue: &#x27;{&quot;version&quot;: &quot;1.0.0&quot;}&#x27; }
  },
  prompts: {
    &#x27;code-review&#x27;: { returnValue: &#x27;Review complete&#x27; }
  }
});

// Use the server
await server.tools[&#x27;read-file&#x27;]({ path: &#x27;/tmp/test.txt&#x27; });

// Access mocks
expect(mocks.tools.get(&#x27;read-file&#x27;)).toHaveBeenCalled();

Spy Functions```javascript

import { spyOn, restoreSpy } from 'mcp-test';

const obj = {
method: () => 'original'
};

const spy = spyOn(obj, 'method');

obj.method(); // Calls original + tracks call

expect(spy).toHaveBeenCalled();

// Restore original
restoreSpy(spy);


## 🎯 Real-World Examples

### Example 1: Testing File Tools```javascript
describe(&#x27;File tools&#x27;, () =&gt; {
  let fileSystem;

  beforeEach(() =&gt; {
    const { server, mocks } = createMockServer({
      tools: {
        &#x27;read-file&#x27;: {
          implementation: ({ path }) =&gt; {
            if (path === &#x27;/tmp/exists.txt&#x27;) {
              return { content: &#x27;File content&#x27;, size: 12 };
            }
            throw new Error(&#x27;File not found&#x27;);
          }
        },
        &#x27;write-file&#x27;: { returnValue: { success: true } }
      }
    });

    fileSystem = { server, mocks };
  });

  test(&#x27;reads existing file&#x27;, async () =&gt; {
    const result = await fileSystem.server.tools[&#x27;read-file&#x27;]({
      path: &#x27;/tmp/exists.txt&#x27;
    });

    expect(result.content).toBe(&#x27;File content&#x27;);
    expect(result.size).toBe(12);
  });

  test(&#x27;throws error for non-existent file&#x27;, async () =&gt; {
    await expect(
      fileSystem.server.tools[&#x27;read-file&#x27;]({ path: &#x27;/tmp/missing.txt&#x27; })
    ).rejects.toThrow(&#x27;File not found&#x27;);
  });

  test(&#x27;writes file successfully&#x27;, async () =&gt; {
    const result = await fileSystem.server.tools[&#x27;write-file&#x27;]({
      path: &#x27;/tmp/new.txt&#x27;,
      content: &#x27;Hello&#x27;
    });

    expect(result.success).toBe(true);
    expect(fileSystem.mocks.tools.get(&#x27;write-file&#x27;)).toHaveBeenCalledWith({
      path: &#x27;/tmp/new.txt&#x27;,
      content: &#x27;Hello&#x27;
    });
  });
});

Example 2: Testing Resources```javascript

describe('Configuration resource', () => {
test('returns configuration', async () => {
const { server } = createMockServer({
resources: {
'config://app.json': {
returnValue: JSON.stringify({
version: '1.0.0',
env: 'production'
})
}
}
});

const config = await server.resources[&#x27;config://app.json&#x27;]();
const parsed = JSON.parse(config);

expect(parsed.version).toBe(&#x27;1.0.0&#x27;);
expect(parsed.env).toBe(&#x27;production&#x27;);

});
});


### Example 3: Testing Prompts```javascript
describe(&#x27;Code review prompt&#x27;, () =&gt; {
  test(&#x27;reviews code and provides feedback&#x27;, async () =&gt; {
    const codeReview = mockPrompt(&#x27;code-review&#x27;, {
      implementation: ({ file, code }) =&gt; {
        const issues = code.includes(&#x27;console.log&#x27;) ? 1 : 0;
        return {
          file,
          issues,
          feedback: issues &gt; 0 ? &#x27;Remove console.log statements&#x27; : &#x27;Looks good&#x27;
        };
      }
    });

    const result = await codeReview.execute({
      file: &#x27;test.js&#x27;,
      code: &#x27;console.log(&quot;debug&quot;);&#x27;
    });

    expect(result.issues).toBe(1);
    expect(result.feedback).toContain(&#x27;Remove console.log&#x27;);
  });
});

Example 4: Error Handling```javascript

describe('Error handling', () => {
test('handles network errors', async () => {
const apiTool = mockTool('fetch-data', {
throwError: new Error('Network timeout')
});

await expect(apiTool.execute()).rejects.toThrow(&#x27;Network timeout&#x27;);

expect(apiTool.errors).toHaveLength(1);
expect(apiTool.errors[0].message).toBe(&#x27;Network timeout&#x27;);

});

test('retries on failure', async () => {
let attempts = 0;
const retryTool = mockTool('retry-tool');

retryTool.mockImplementation(() =&gt; {
  attempts++;
  if (attempts &lt; 3) {
    throw new Error(&#x27;Temporary failure&#x27;);
  }
  return { success: true };
});

// Implement retry logic
let result;
for (let i = 0; i &lt; 3; i++) {
  try {
    result = await retryTool.execute();
    break;
  } catch (e) {
    if (i === 2) throw e;
  }
}

expect(result.success).toBe(true);
expect(retryTool).toHaveBeenCalledTimes(3);

});
});


## 🧪 Testing the Framework

Run the self-test suite:```bash
npm test

This runs 31 tests covering all framework functionality.

📊 Test Results```

📊 Test Summary:
Total: 31
✓ Passed: 31
Pass Rate: 100%


## 🔧 CLI Usage```bash
# Run test files
mcp-test run tests/**/*.test.js

# Run specific file
mcp-test run my-server.test.js

# Verbose output
mcp-test run --verbose

# Bail on first failure
mcp-test run --bail

# Initialize example test
mcp-test init

🎓 Comparison with Other Tools

Feature MCP Test MCP Inspector Jest Mocha
MCP-specific ✅ ✅ ❌ ❌
Programmatic ✅ ❌ ✅ ✅
Mock utilities ✅ ❌ ✅ ❌
Async/await ✅ N/A ✅ ✅
Tool mocking ✅ ✅ ❌ ❌
Resource mocking ✅ ✅ ❌ ❌
Prompt mocking ✅ ✅ ❌ ❌
Visual testing ❌ ✅ ❌ ❌

MCP Test is the only programmatic testing framework designed specifically for MCP servers.

🤝 Contributing

Contributions welcome! Please read CONTRIBUTING.md for guidelines.

📄 License

MIT License - see LICENSE file for details

🔗 Resources

  • Model Context Protocol Docs
  • MCP Inspector
  • Jest Documentation

Built with ❤️ for the MCP community

常见问题

5 问
答案由本站依据条目字段整理,不引用上游原文
Anyrxo MCP 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Anyrxo MCP 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

Anyrxo MCP 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Anyrxo MCP 需要 API Key 吗?

资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

Anyrxo MCP 能提供哪些能力?

资料显示能力标签包括 测试框架、TypeScript、云端部署。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。