- Home
- MCP servers
- Calculator
Calculator
- typescript
11
GitHub Stars
typescript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"crazyrabbitltc-mcp-test-client": {
"command": "bun",
"args": [
"./tests/mocks/calculator.ts"
]
}
}
}You can test and interact with MCP servers using a lightweight test client that starts a server, discovers its available tools, and validates tool responses. This makes it easy to verify tool behavior, ensure correctness, and demonstrate how your MCP server integrates with tooling in real-world scenarios.
How to use
Start by launching the MCP server locally through a standalone test client. You run the client with the command that starts your server process, then use the client to list available tools and call specific tools to verify their outputs. You can write tests that assert on tool responses to ensure consistent behavior as your server evolves.
How to install
Prerequisites you need before getting started: install a JavaScript runtime that can execute modern TypeScript tooling and a package runner compatible with MCP workflows.
Step 1: Install the test client package using your preferred package manager.
Step 2: Set up and start your MCP server within the test client workflow by providing the exact command and arguments that run your server. For example, you can configure the client to use a local Bun-based server script.
Step 3: Run tests to verify tool discovery and tool calls. The client includes utilities to list tools and to call specific tools with assertions.
Additional notes
The testing setup includes a mock calculator server you can use to learn the workflow and see how tool calls are validated. You typically start the calculator mock server through the same client, then perform a tool call and assert the expected result.
Key capabilities include listing available tools and performing tool calls with assertion hooks to validate responses. This enables you to create reliable tests that catch regressions as your MCP server changes.
Available tools
listTools
Retrieves the list of available tools from the server to enable discovery and exploration of server capabilities.
calculate
Performs a calculation operation via the server, demonstrated by the mock calculator example in tests.