Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Mcp Js Server

    An unofficial JavaScript SDK for Model Context Protocol

    5 stars
    JavaScript
    Updated Aug 5, 2025
    ai
    mcp
    stdio

    Table of Contents

    • Usage
    • Prompts
    • Resources
    • Tools
    • Server
    • Debugging

    Table of Contents

    • Usage
    • Prompts
    • Resources
    • Tools
    • Server
    • Debugging

    Documentation

    MCP Server - JavaScript SDK

    This is an unofficial JavaScript SDK for Model Context Protocol.

    Usage

    Import the package to your project:

    bash
    npm install mcp-js-server

    Create files to define the server's prompts, resources, and tools. See mcp-clever-demo, or the examples below:

    Prompts

    javascript
    // prompts.js
    export const prompts = {
        hello_world: {
            description: 'A simple prompt that says hello.',
            arguments: [],
            messages: [{
                role: 'assistant',
                content: {
                    type: 'text',
                    text: 'Hello, world!'
                }
            }]
        }
    };

    Resources

    javascript
    // resources.js
    export const resources = {
        apiReference: {
            uri: 'https://api.example.com/openapi.json',
            mimeType: 'application/json'
        }
    };

    Tools

    javascript
    // tools.js
    export const tools = {
        simple_tool: {
            description: 'A simple tool',
            handler: async () => new Date().toLocaleString(),
            schema: {
                type: 'object',
                properties: {},
                required: []
            }
        },
        complex_tool: {
            description: 'A complex tool',
            handler: async ({ param1, param2 }) => {
                return `param1: ${param1}, param2: ${param2}`;
            },
            schema: {
                type: 'object',
                properties: {
                    param1: { type: 'string' },
                    param2: { type: 'string' }
                },
                required: ['param1', 'param2']
            }
        }
    };

    Server

    Then create a server instance with the following code:

    javascript
    // server.js
    import { MCP } from 'mcp-server';
    import { tools } from './tools.js';
    import { prompts } from './prompts.js';
    import { resources } from './resources.js';
    
    const infos = {
        name: 'mcp-demo-server',
        version: '0.1.0'
    };
    
    const server = new MCP(infos, prompts, resources, tools);

    Debugging

    You can find logs of the server in your user system logs directory:

    code
    Linux:   ~/.local/share/logs
    macOS:   ~/Library/Logs
    Windows: %USERPROFILE%\AppData\Local\Logs

    Similar MCP

    Based on tags & features

    • AN

      Anyquery

      Go·
      1.4k
    • MC

      Mcp Open Library

      TypeScript·
      42
    • AN

      Anilist Mcp

      TypeScript·
      57
    • MC

      Mcp Ipfs

      TypeScript·
      11

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • AN

      Anyquery

      Go·
      1.4k
    • MC

      Mcp Open Library

      TypeScript·
      42
    • AN

      Anilist Mcp

      TypeScript·
      57
    • MC

      Mcp Ipfs

      TypeScript·
      11

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k