Skip to main content
Glama
Henryk91
by Henryk91

Custom MCP Server: Calculator & Workflow Automation

This is a custom Model Context Protocol (MCP) server built with Python using the FastMCP framework. It provides a set of calculator tools, resources for customer support, and prompts for content creation, along with integration to external n8n workflows.

Features

🛠️ Tools

Tools allow the AI model to perform actions or computations.

  • add(a, b): Add two numbers.

  • subtract(a, b): Subtract two numbers.

  • multiply(a, b): Multiply two numbers.

  • divide(a, b): Divide two numbers (handles division by zero).

  • trigger_n8n_workflow(prompt): Triggers a remote n8n workflow via webhook, sending a prompt and returning the response.

📚 Resources

Resources provide context and data to the AI model.

  • calculator://support-playbook: Reads and returns the content of the "Customer Support Playbook" (resource_exampe.md).

📝 Prompts

Prompts provide structured templates for the AI model to generate content.

  • webinar_blog_post: A template to convert a webinar transcript into an engaging blog post. requires: webinar_title, webinar_date, speakers, transcript.

Related MCP server: MCP Server for n8n Integration

Prerequisites

  • Python 3.10+ (Recommend managing with uv)

  • uv: A fast Python package installer and resolver.

  • npx: Required if you want to use the MCP Inspector for testing.

Installation & Setup

  1. Clone or Navigate to the Project Directory

  2. Install Dependencies Use uv to sync the project dependencies:

    uv sync
  3. Configure Environment Variables This server requires environment variables for the n8n integration.

    Create a .env file from the example:

    cp .env.example .env

    Open .env and configure your settings:

    N8N_WEBHOOK_URL=https://your-n8n-instance.com/webhook/...
    N8N_HEADER_NAME=Your-Header-Name
    N8N_HEADER_VALUE=Your-Header-Value

    Note: If N8N_HEADER_NAME and N8N_HEADER_VALUE are set, they will be included in the webhook request headers.

Usage

🔍 Testing with MCP Inspector

The MCP Inspector is a developer tool to test your server's tools, resources, and prompts in a web interface.

Run the follow command:

npx @modelcontextprotocol/inspector uv run server.py

This will launch a local server (usually at http://localhost:5173) where you can interact with your MCP server.

🤖 Integration with Claude for Desktop

To use this server with the Claude desktop app:

  1. Locate Configuration File:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

  2. Update Configuration: Add the server configuration to the mcpServers object. You can copy the contents of the claude_desktop_config.json file provided in this repository.

    {
      "mcpServers": {
        "calculator": {
          "command": "uv",
          "args": ["--directory", "/ABSOLUTE/PATH/TO/THIS/PROJECT", "run", "server.py"]
        }
      }
    }

    Important: Replace /ABSOLUTE/PATH/TO/THIS/PROJECT with the actual absolute path to this directory on your machine.

  3. Restart Claude: Restart the Claude application to load the new server.

Troubleshooting

  • Timeout Errors: The n8n workflow trigger has a 30-second timeout. If your workflow takes longer, you may need to increase this in server.py.

  • Missing Environment Variables: Ensure your .env file is properly set up and that you are running the server from the project root where the .env file is located.

  • Claude Connection Issues: Check Claude's logs for connection details. Ensure the absolute path in the config file is correct.

Project Structure

  • server.py: Main MCP server implementation.

  • resource_exampe.md: Source file for the support playbook resource.

  • prompt.md: Template file for the blog post prompt.

  • .env: (Ignored by git) Local configuration for secrets.

  • pyproject.toml: Python project and dependency definition.

Available Tools

5 tools
addA

Add two numbers

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description is a pure function with no side effects, and the sole behavior 'Add two numbers' is fully disclosed. With no annotations to contradict, the description provides complete behavioral transparency for this simple operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no unnecessary words; it is front-loaded and earns its place. It communicates everything needed in the most compact form possible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simple nature and the presence of an output schema (per context signal), the description sufficiently covers the function. There are no complex behaviors, side effects, or conditional logic to document.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet the description only generically mentions 'two numbers' without explaining the meaning or constraints of parameters a and b. It does not compensate for the lack of schema descriptions, leaving parameter semantics under-specified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Add' and identifies the resource as 'two numbers', clearly distinguishing it from the sibling arithmetic tools subtract, multiply, and divide. It is unambiguous and precisely states the tool's function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description is concise but does not explicitly state when to use this tool over alternatives; however, the operation is self-evident for the sibling context. It lacks explicit exclusions or alternative guidance, but the clear context of adding numbers implicitly covers the main use case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

divideC

Divide two numbers

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.4/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden of behavioral disclosure. It merely states 'divide two numbers' but does not address critical behaviors such as division by zero, error handling, or whether the result is a float or integer. No extra context is provided.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is not verbose, but it is under-specified. It is too sparse to be considered well-structured for a tool with potential edge cases, making it less about conciseness and more about missing critical information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple, but the description fails to cover important aspects like division by zero behavior or result type. Even though an output schema exists, it cannot clarify runtime errors or edge cases, leaving the description incomplete for practical use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not compensate. It only says 'two numbers' without elaborating on the meaning of parameters a and b, their types, or constraints, adding no value beyond the parameter names and types already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses specific verb 'Divide' and resource 'two numbers', clearly distinguishing from sibling tools add, subtract, and multiply.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No mention of when to use this tool versus alternatives, no prerequisites, exclusions, or context. The description provides no usage guidance beyond the basic operation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

multiplyA

Multiply two numbers

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

There are no annotations, so the description carries the burden of behavioral disclosure. It states the core operation but does not explicitly mention the return value or any edge cases, though the behavior is largely self-evident for a simple multiply operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no filler or redundancy. It is concise and immediately understandable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool and the presence of an output schema, the description is complete enough. It states the operation clearly, and the parameter schema defines the inputs sufficiently.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameter descriptions and 0% schema coverage. The description adds that the operation involves 'two numbers', which adequately covers the symmetric parameters a and b, but it doesn't provide per-parameter detail beyond that.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the operation with a specific verb ('Multiply') and resource ('two numbers'). It is immediately distinct from sibling tools like add, subtract, and divide.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for multiplication but provides no explicit guidance on when to choose this tool over the alternatives. There are no exclusions or alternative recommendations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

subtractA

Subtract two numbers

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must carry the behavioral disclosure burden. It implies a pure function with no side effects, but it does not explicitly state the order of operands (a-b vs b-a) or behavior on errors/edge cases. For a trivial arithmetic operation, this is acceptable but not fully transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no fluff. It is front-loaded and every word earns its place, making it highly efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simplicity of the tool and the presence of an output schema, the description is mostly complete for a basic arithmetic operation. However, it lacks any usage context and does not explicitly state the operand order, so it is not a 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has no descriptions for parameters, so the description must compensate. It only says 'two numbers', which adds little beyond the schema's integer types. It does not clarify that 'a' is the minuend and 'b' the subtrahend, leaving potential ambiguity in the order of subtraction.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Subtract two numbers' clearly states the action (subtract) and the resource (two numbers), and it distinguishes itself from sibling tools (add, multiply, divide) by naming the specific operation. It is a specific verb+resource statement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description offers no guidance on when to use this tool versus alternatives. It does not mention any conditions, prerequisites, or scenarios appropriate for subtraction, nor does it reference sibling tools like 'add' or 'multiply'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

trigger_n8n_workflowC

Trigger an n8n workflow with a prompt

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.5/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden for behavioral disclosure. 'Trigger an n8n workflow' implies an external side effect, but the description omits any information about authentication, asynchronous behavior, rate limits, or potential impact.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, short sentence with no redundant words, making it easy to scan. It is under-specified overall, but no words are wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with one parameter, but as an external workflow trigger it lacks essential context about side effects and expected behavior. The output schema may cover return values, but description-level completeness is insufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, and the description only repeats that a 'prompt' is used without adding format, length limits, or examples. It adds minimal value beyond the schema's bare parameter name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Trigger') and resource ('n8n workflow'), clearly indicating the action. It differs sharply from sibling tools (add, subtract, multiply, divide), making the intended operation unambiguous, though it does not specify which n8n workflow.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided about when to use this tool versus alternatives. The sibling tools are clearly arithmetic, so use is implied, but the description does not state prerequisites, context, or exclusion criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv0.1.0
    • First observedadd
    • First observeddivide
    • First observedmultiply
    • First observedsubtract
    • First observedtrigger_n8n_workflow

TDQS

B3.2/5.0
Disambiguation5/5

The four arithmetic tools have clear, distinct purposes, and the workflow trigger is unrelated, so there is no ambiguity between any of the tools.

Naming Consistency3/5

The arithmetic tools use simple single-word verbs (add, subtract), while trigger_n8n_workflow uses a verb_noun pattern with an underscore, breaking the otherwise consistent naming convention.

Tool Count5/5

Five tools is within the ideal range, and each tool is simple and focused, though the mix of calculator functions and a workflow trigger is eclectic.

Completeness3/5

The arithmetic set covers basic operations but lacks advanced ones like exponentiation or modulo, and the workflow trigger has no supporting tools, leaving gaps in both implied domains.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    A Model Context Protocol server that enables AI assistants to interact with n8n workflows through natural language, supporting actions like listing, creating, updating, executing and monitoring workflows.
    224
    1,637
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A Model Context Protocol server that provides AI assistants with comprehensive access to n8n node documentation, properties, and operations for effective workflow automation.
    28
    123,606
    22,825
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server that provides AI assistants with comprehensive access to n8n node documentation, properties, and operations, enabling them to understand and work with n8n's 525+ workflow automation nodes.
    123,606
    34
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Henryk91/custom-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server