Skip to main content
Glama
hotjoebq
by hotjoebq

MCP Stdio Server

A complete Model Context Protocol (MCP) server implementation using stdio transport that showcases:

  • Resources: File system access to read project files (README.md, package.json, src/server.ts)

  • Tools: Calculator for mathematical operations and file listing

  • Prompts: Code review and code explanation assistants

Features

  • MCP server with stdio transport

  • File reading resources for project files

  • Mathematical calculator tool

  • Directory listing tool

  • Code review and explanation prompt templates

  • VSCode integration ready

  • Test client for basic functionality testing

Related MCP server: MCP Server Demo

Setup

  1. Install dependencies:

npm install
  1. Build the project:

npm run build

Testing Options

Option 1: Basic Functionality Test (No Additional Tools Required)

npm run test-simple

This runs a simple client that tests basic MCP communication with the server.

Option 2: Comprehensive Testing (Requires mcp-cli Installation)

First, install mcp-cli globally:

npm install -g @modelcontextprotocol/cli

Then run comprehensive tests:

# Set the MCP configuration
export MCP_CLI_CONFIG_PATH=$(pwd)/mcp_config.json
# On Windows Command Prompt, use: set MCP_CLI_CONFIG_PATH=%cd%\mcp_config.json

# List available tools
mcp-cli tool list --server hjmcp-stdio

# Test calculator tool
mcp-cli tool call calculate --server hjmcp-stdio --input '{"expression": "2 + 3 * 4"}'

# Test file listing tool
mcp-cli tool call list_files --server hjmcp-stdio --input '{"directory": "."}'

# Test resource reading
mcp-cli tool read file://package.json --server hjmcp-stdio

VSCode Integration (No mcp-cli Required)

VSCode has built-in MCP support and connects directly to your server. You do NOT need to install mcp-cli for VSCode integration.

Add this to your VSCode MCP settings to use this server:

{
  "mcpServers": {
    "hjmcp-stdio": {
      "command": "node",
      "args": ["dist/server.js"],
      "cwd": "/absolute/path/to/your/hjmcpstdio/directory",
      "transport": "stdio"
    }
  }
}

Important Notes:

  • Replace /absolute/path/to/your/hjmcpstdio/directory with the actual absolute path to this project directory

  • Make sure you've run npm run build first to compile the TypeScript

  • VSCode will handle all MCP communication automatically - no additional tools needed

Available npm Scripts

  • npm run build - Compile TypeScript to JavaScript

  • npm run dev - Watch mode compilation

  • npm run start - Run the MCP server directly

  • npm run test-simple - Run basic client test

  • npm run clean - Remove build files

Server Capabilities

Resources

  • file://README.md - Project documentation

  • file://package.json - Package configuration

  • file://src/server.ts - Server source code

Tools

  • calculate - Perform mathematical calculations

    • Input: {"expression": "mathematical expression"}

    • Example: {"expression": "2 + 3 * 4"}

  • list_files - List files in a directory

    • Input: {"directory": "relative path"} (optional, defaults to ".")

    • Example: {"directory": "src"}

Prompts

  • code-review - Get code review suggestions

    • Arguments: file_path (required), focus_areas (optional)

  • explain-code - Get code explanations

    • Arguments: code_snippet (required), language (optional)

Project Structure

  • src/server.ts - Main MCP server implementation

  • src/simple-client.ts - Basic test client

  • mcp_config.json - MCP CLI configuration for testing

  • package.json - Project configuration and dependencies

  • tsconfig.json - TypeScript configuration

Testing Summary

Quick Testing (No Additional Setup):

  • Use npm run test-simple for basic functionality verification

Comprehensive Testing (Requires mcp-cli):

  • Install mcp-cli globally: npm install -g @modelcontextprotocol/cli

  • Use mcp-cli commands for detailed tool and resource testing

VSCode Integration (No mcp-cli Needed):

  • Add server configuration to VSCode MCP settings

  • VSCode handles MCP communication automatically

The server has been tested with:

  • ✅ Tool functionality (calculate, list_files)

  • ✅ Resource reading (package.json confirmed working)

  • ✅ Stdio transport communication

  • ✅ MCP protocol compliance

  • ✅ Cross-platform compatibility (Windows, macOS, Linux)

Available Tools

2 tools
calculateC

Perform mathematical calculations

ParametersJSON Schema
NameRequiredDescriptionDefault
expressionYesMathematical expression to evaluate (e.g., '2 + 3 * 4')

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions 'perform' but doesn't disclose behavioral traits like error handling, precision, supported operations, or output format. It's minimal and lacks necessary context for a tool with no annotations.

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, efficient sentence with zero waste. It's appropriately sized and front-loaded, making it easy to parse quickly.

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?

Given no annotations, no output schema, and a single parameter with full schema coverage, the description is incomplete. It doesn't explain return values, error cases, or behavioral context, leaving significant gaps for a tool that performs calculations.

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?

Schema description coverage is 100%, so the schema already documents the 'expression' parameter. The description adds no meaning beyond what the schema provides, such as examples of complex expressions or limitations. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose3/5

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

The description 'Perform mathematical calculations' states a general purpose but lacks specificity about what kind of calculations or resources are involved. It doesn't distinguish from the sibling 'list_files', but it's not tautological with the name 'calculate'.

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 provides no guidance on when to use this tool versus alternatives or any contextual prerequisites. It's a standalone statement with no implied usage scenarios or exclusions.

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

list_filesC

List files in the project directory

ParametersJSON Schema
NameRequiredDescriptionDefault
directoryNoDirectory path relative to project root (default: '.').

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states it's a list operation, implying read-only behavior, but doesn't mention any constraints like permissions, rate limits, pagination, or what happens with invalid paths. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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, clear sentence with no wasted words. It's front-loaded with the core purpose, making it highly efficient and easy to parse.

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?

Given no annotations and no output schema, the description is incomplete for a tool that likely returns a list of files. It doesn't explain the return format, error conditions, or behavioral details, leaving the agent with insufficient context for reliable use.

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?

Schema description coverage is 100%, with the parameter 'directory' fully documented in the schema. The description doesn't add any meaning beyond the schema, but the baseline is 3 when schema coverage is high, as the schema already provides adequate parameter information.

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 clearly states the verb ('List') and resource ('files in the project directory'), making the purpose immediately understandable. It doesn't distinguish from the sibling tool 'calculate', but that's a different function, so the lack of explicit differentiation doesn't significantly harm clarity.

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 on when to use this tool versus alternatives or in what context it's appropriate. The description only states what it does, not when or why to invoke it, leaving the agent without usage context.

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. 2 tool updatesv1.0.0
    • First observedcalculate
    • First observedlist_files

TDQS

C2.9/5.0
Disambiguation5/5

The two tools have completely distinct purposes: 'calculate' handles mathematical operations, while 'list_files' deals with file system navigation. There is no overlap or ambiguity between these functions, making tool selection straightforward for an agent.

Naming Consistency3/5

The naming is mixed: 'calculate' uses a verb-only format, while 'list_files' follows a verb_noun pattern. Although both are readable, the inconsistency in naming conventions (one tool lacking an object) prevents a higher score for consistency.

Tool Count2/5

With only two tools, the server feels thin and under-scoped for a 'Stdio Server' which typically implies broader utility or system operations. This minimal set may limit agent capabilities in handling diverse tasks, suggesting an incomplete or overly narrow implementation.

Completeness2/5

Given the server name 'MCP Stdio Server', which implies standard input/output or general system utilities, the toolset is severely incomplete. It lacks essential operations like reading/writing files, executing commands, or managing processes, creating significant gaps that will hinder agent workflows.

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
    B
    quality
    F
    maintenance
    A Model Context Protocol server that provides tools for code modification and generation via Large Language Models, allowing users to create, modify, rewrite, and delete files using structured XML instructions.
    12
    2
    MIT
  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    A demonstration MCP server that provides calculator tools for arithmetic operations, personalized greeting resources, and code review prompt templates. Enables users to perform basic math calculations, generate dynamic greetings, and access reusable code review templates through the Model Context Protocol.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides file reading and mathematical calculation tools through the Model Context Protocol. Enables reading file contents and evaluating mathematical expressions via stdio transport.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    A Model Context Protocol server providing file search and question tools for AI models. Enables keyword search in files with line numbers and integration with external chat services.
    225
    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/hotjoebq/hjmcpstdio'

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