https://github.com/wrtnlabs/calculator-mcp
Calculator MCP server on npx
https://github.com/wrtnlabs/calculator-mcp
calculator mcp node npx
Last synced: 6 months ago
JSON representation
Calculator MCP server on npx
- Host: GitHub
- URL: https://github.com/wrtnlabs/calculator-mcp
- Owner: wrtnlabs
- License: mit
- Created: 2025-04-08T07:33:38.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-04-15T08:50:23.000Z (6 months ago)
- Last Synced: 2025-04-15T09:39:54.200Z (6 months ago)
- Topics: calculator, mcp, node, npx
- Language: TypeScript
- Homepage:
- Size: 162 KB
- Stars: 9
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- mcp-index - Calculator - Provides basic calculator functionalities for performing arithmetic operations such as addition, subtraction, multiplication, division, modulus, and square root. Integrates with development environments like VS Code to enhance agent capabilities, useful for testing MCP connections or for simple computational tasks. (Task and Project Management)
README
## Calculate MCP
A Model Context Protocol (MCP) server that provides browser automation capabilities using basic calculator feature.
This server enables LLMs to interact with calculator.
(I actually made it for a test program)### Use Cases
- The test code for to connect MCP feature.
- The toy projects### Example config
```js
{
"mcpServers": {
"calculate": {
"command": "npx",
"args": [
"-y",
"@wrtnlabs/calculator@latest"
]
}
}
}
```#### Installation in VS Code
Alternatively, you can install the Playwright MCP server using the VS Code CLI:
```bash
# For VS Code
code --add-mcp '{"name":"calculator","command":"npx","args":["-y", "@wrtnlabs/calculator-mcp@latest"]}'
``````bash
# For VS Code Insiders
code-insiders --add-mcp '{"name":"calculator","command":"npx","args":["-y", "@wrtnlabs/calculator-mcp@latest"]}'
```After installation, the Calculator MCP server will be available for use with your GitHub Copilot agent in VS Code.
### CLI Options
The Calculator MCP server supports the following command-line options:
- `--port `: Port to listen on for SSE transport
### Running headed browser on Linux w/o DISPLAY
When running headed browser on system w/o display or from worker processes of the IDEs,
run the MCP server from environment with the DISPLAY and pass the `--port` flag to enable SSE transport.```bash
npx @wrtnlabs/calculator-mcp@latest --port 8931
```And then in MCP client config, set the `url` to the SSE endpoint:
```js
{
"mcpServers": {
"calculator": {
"url": "http://localhost:8931/sse"
}
}
}
```### Programmatic usage with custom transports
```js
import { createServer } from "@wrtnlabs/calculator-mcp";
// ... other import statementconst client = new Client({
name: "test client",
version: "0.1.0",
});const server = createServer({
name: "calculator",
version: "1.0.0"
});const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();
await Promise.all([
client.connect(clientTransport),
server.connect(serverTransport),
]);
```### Tools
- **add**
- **sub**
- **mul**
- **div**
- **mod**
- **sqrt**