Skip to main content
Glama

mcp-flyin

My JavaScript MCP Server

A Model Context Protocol (MCP) server built with JavaScript that provides basic tools and resources.

Features

Tools

  • echo: Echo back any message
  • calculate: Perform basic arithmetic operations (add, subtract, multiply, divide)
  • get_system_info: Get basic system information

Resources

  • package.json: Access to the server's package configuration

Installation

  1. Make sure you have Node.js installed
  2. Install dependencies:
    npm install

Usage

Running the Server

npm start

Development Mode

npm run dev

Testing with MCP Inspector

You can test your server using the MCP Inspector:

npx @modelcontextprotocol/inspector node server.js

Configuration

This server runs on stdio transport, which means it communicates through standard input/output. This is the most common way to run MCP servers.

Example Usage

Once connected to an MCP client, you can:

  1. Echo a message:
    • Tool: echo
    • Parameters: {"message": "Hello, World!"}
  2. Perform calculations:
    • Tool: calculate
    • Parameters: {"operation": "add", "a": 5, "b": 3}
  3. Get system information:
    • Tool: get_system_info
    • Parameters: {}
  4. Read resources:
    • Resource: file://package.json

Extending the Server

To add new tools or resources:

  1. Add tool definitions to the ListToolsRequestSchema handler
  2. Add tool logic to the CallToolRequestSchema handler
  3. Add resource definitions to the ListResourcesRequestSchema handler
  4. Add resource reading logic to the ReadResourceRequestSchema handler

Error Handling

The server includes proper error handling for:

  • Division by zero in calculations
  • Unknown tools and resources
  • File reading errors
  • Graceful shutdown on SIGINT
-
security - not tested
F
license - not found
-
quality - not tested

A server that handles messaging or commands over a custom protocol

  1. Features
    1. Tools
    2. Resources
  2. Installation
    1. Usage
      1. Running the Server
      2. Development Mode
      3. Testing with MCP Inspector
    2. Configuration
      1. Example Usage
        1. Extending the Server
          1. Error Handling

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              An MCP server to run commands.
              Last updated -
              2
              933
              160
              TypeScript
              MIT License
              • Apple
            • A
              security
              F
              license
              A
              quality
              A MCP Server used to collect MCP Servers over the internet.
              Last updated -
              3
              18
              Python
              • Apple
            • -
              security
              A
              license
              -
              quality
              A server that provides document processing capabilities using the Model Context Protocol, allowing conversion of documents to markdown, extraction of tables, and processing of document images.
              Last updated -
              6
              Python
              MIT License
              • Linux
              • Apple
            • -
              security
              A
              license
              -
              quality
              A hub server that connects to and manages other MCP (Model Context Protocol) servers.
              Last updated -
              131
              26
              TypeScript
              MIT License

            View all related MCP servers

            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/balajidommeti/MCP'

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