JS MCP Server
@Positive-Spaces
关于 JS MCP Server
JavaScript MCP Server Component with WASM SDK for easy integration and deployment.
基本信息
配置
工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is JS MCP Server?
JS MCP Server is a JavaScript Model Context Protocol server component built with a WebAssembly SDK. It allows developers to create MCP servers in JavaScript that compile to WebAssembly, integrating with Postgres databases and external HTTP APIs through developer-friendly abstractions.
How to use JS MCP Server?
Clone the repository, install the required global tools (@bytecodealliance/componentize-js and @bytecodealliance/jco), install local dependencies, and run npm run build to generate the WebAssembly module at dist/js-mcp-server.wasm. Customize the server by adding handler functions (tools) in the handlers directory and registering them in server.js.
Key features of JS MCP Server
- Compiles JavaScript MCP servers to WebAssembly modules.
- Developer-friendly HTTP client with GET, POST, PUT, and more.
- Async Postgres query interface for database-backed tools.
- Custom handler registration with name, description, and schema.
- Built-in support for error handling and graceful JSON parsing.
- Easy integration with existing JavaScript projects via Vite bundling.
Use cases of JS MCP Server
- Knowledge graph tools: Query a Postgres database to retrieve entity data.
- External API integration: Fetch data from any REST API (e.g., random dog images).
- Custom tool creation: Easily add new MCP tools by writing handler functions.
- Lightweight server deployment: Package your MCP server as a WASM module for portable execution.
FAQ from JS MCP Server
What dependencies are required to build JS MCP Server?
You need Node.js, npm, and the global packages @bytecodealliance/componentize-js and @bytecodealliance/jco. Local npm dependencies are installed via npm install.
How do I add a new custom tool/handler?
Create a new JavaScript file in the handlers directory with an exported handler function and tool metadata. Import it in server.js, then add it to the tools object in the createMcpServer call.
Can I query a database with JS MCP Server?
Yes, you can use the query function from the comapi:postgres/[email protected] interface for async Postgres queries. Parameters must be wrapped as WIT enum/variants (e.g., { tag: 'text', val: value }).
How do I make HTTP requests from my handler?
Use the SDK’s HTTP client functions like get(url, options) or post(url, data, options). Set { json: true } to automatically parse JSON responses. Custom clients can be created via createHttpClient.
What is the output of the build process?
The build produces a WebAssembly module (dist/js-mcp-server.wasm) that encapsulates your JavaScript MCP server, including all registered tools and configured handlers.
其他 分类下的更多 MCP 服务器
AutoBrowser MCP
autobrowser-aiBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.
Activepieces
activepiecesAI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
Awesome Mcp Servers
punkpeyeA collection of MCP servers.
MCP Registry
modelcontextprotocolA community driven registry service for Model Context Protocol (MCP) servers.
评论