MCP_Server_with_http_OAuth_stdio

Legitate/MCP_Server_with_http_OAuth_stdio

3.2

If you are the rightful owner of MCP_Server_with_http_OAuth_stdio and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Model Context Protocol (MCP) server with employee management capabilities, supporting both HTTP and STDIO transports.

Tools
2
Resources
0
Prompts
0

MCP Node Server

A Model Context Protocol (MCP) server with employee management capabilities, supporting both HTTP and STDIO transports.

Features

  • Dual Transport Support
    • HTTP transport (REST API with OAuth 2.0)
    • STDIO transport (JSON-RPC 2.0 for MCP clients)
  • Employee Management
    • Create employees
    • List employees
  • OAuth 2.0 Authentication (HTTP transport)
  • MCP Protocol Compliance (STDIO transport)

Requirements

  • Node.js 18+
  • npm

Installation

npm install

Running the Server

HTTP Transport (REST API)

Start the HTTP server:

npm start
# or
npm run dev  # with auto-reload

Server runs at: http://127.0.0.1:8080

Features:

  • OAuth 2.0 client credentials flow
  • REST API endpoints
  • Server-Sent Events (SSE) support

See for HTTP API documentation.

STDIO Transport (JSON-RPC 2.0)

Start the STDIO server:

npm run start:stdio
# or
npm run dev:stdio  # with auto-reload

Features:

  • JSON-RPC 2.0 protocol
  • Compatible with Claude Desktop and other MCP clients
  • No authentication (local process)

See for STDIO protocol documentation.

Quick Start

HTTP Transport

  1. Register a client:
curl -X POST http://127.0.0.1:8080/mcp/register
  1. Get an access token:
curl -X POST http://127.0.0.1:8080/mcp/token \
  -H "Content-Type: application/json" \
  -d '{"grant_type":"client_credentials","client_id":"...","client_secret":"..."}'
  1. Create an employee:
curl -X POST http://127.0.0.1:8080/mcp/call \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"tool":"employee_create","params":{"name":"Alice","department":"Engineering"}}'

STDIO Transport

The STDIO server communicates via JSON-RPC messages over stdin/stdout. See for examples.

Testing

Test HTTP Server

./test-api.sh

Test STDIO Server

node test-stdio.js

Project Structure

mcp_server/
├── src/
│   ├── server.js          # HTTP transport server
│   ├── stdio-server.js    # STDIO transport server
│   ├── oauth.js           # OAuth 2.0 implementation
│   └── employees.js       # Shared employee management
├── data/
│   ├── employees.json     # Employee data store
│   ├── clients.json       # OAuth clients
│   └── tokens.json        # OAuth tokens
├── API_GUIDE.md          # HTTP API documentation
├── STDIO_GUIDE.md        # STDIO protocol documentation
└── QUICK_START.md        # Quick reference

Available Tools

employee_create

Creates a new employee record.

Parameters:

  • name (required): Employee name
  • department (optional): Department name
  • role (optional): Job role
  • email (optional): Email address

employee_list

Lists all employees.

Parameters: None

Transport Comparison

FeatureHTTPSTDIO
ProtocolREST APIJSON-RPC 2.0
AuthOAuth 2.0None
Use CaseRemote APILocal MCP clients
Clientcurl, Postman, etc.Claude Desktop, etc.

Documentation

  • - Complete HTTP API documentation
  • - STDIO protocol guide
  • - Quick reference

License

MIT