MCP JavaScript Server
Provides a JavaScript SDK for implementing the Model Context Protocol, allowing developers to build MCP servers using JavaScript
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP JavaScript Servershow me how to define a new tool with parameters"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server - JavaScript SDK
This is an unofficial JavaScript SDK for Model Context Protocol.
Usage
Import the package to your project:
npm install mcp-js-serverCreate files to define the server's prompts, resources, and tools. See mcp-clever-demo, or the examples below:
Prompts
// 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
// resources.js
export const resources = {
apiReference: {
uri: 'https://api.example.com/openapi.json',
mimeType: 'application/json'
}
};Tools
// 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:
// 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:
Linux: ~/.local/share/logs
macOS: ~/Library/Logs
Windows: %USERPROFILE%\AppData\Local\LogsThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceA Python implementation of the Model Context Protocol that allows applications to provide standardized context for LLMs, enabling creation of servers that expose data and functionality to LLM applications through resources, tools, and prompts.Last updatedMIT
- AlicenseAqualityDmaintenanceA template for building Model Context Protocol servers that allow AI assistants to interact with custom data and services through queryable resources and specialized tools.Last updated6MIT
- Alicense-qualityDmaintenanceA toolkit for building Model Context Protocol servers and clients that provide standardized context for LLMs, allowing applications to expose resources, tools, and prompts through stdio or Streamable HTTP transports.Last updated48,250,012MIT
- Alicense-qualityAmaintenanceA lightweight SDK for building Model Context Protocol (MCP) servers with zero-config setup, automatic TypeScript type inference, and Zod runtime validation.Last updated112MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
MCP (Model Context Protocol) server for Appwrite
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/davlgd/mcp-js-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server