MCP Declarative Server
Allows installation of the MCP server through the npm package manager with the 'mcp-client-router' package.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP Declarative Server
A utility module for creating Model Context Protocol (MCP) servers declaratively.
Installation
npm install mcp-client-routerRelated MCP server: Python MCP Server Kit
Usage
import { MCPDeclarativeServer } from "mcp-client-router/declarative-server";
// Create a server declaratively
const server = new MCPDeclarativeServer({
name: "my-server",
version: "1.0.0",
// Define tools as arrays of arguments
tools: [
[
"greeting",
{ message: "string" },
async ({ message }) => ({
content: [{ type: "text", text: `Hello, ${message}!` }],
}),
],
[
"farewell",
{ name: "string" },
async ({ name }) => ({
content: [{ type: "text", text: `Goodbye, ${name}!` }],
}),
],
],
// Define prompts
prompts: [
[
"welcome",
{ name: "string", formality: { type: "string", default: "CASUAL" } },
async ({ name, formality }) => {
const text =
formality === "FORMAL"
? `Dear ${name}, welcome to our service.`
: `Hi ${name}! Welcome aboard!`;
return {
messages: [{ role: "assistant", content: { text } }],
};
},
"A welcome prompt template",
],
],
// Define resources
resources: [
[
"docs/readme",
async () => ({
contents: [
{
uri: "docs/readme",
text: "This is the documentation readme file.",
},
],
}),
],
],
});
// Connect to a transport
await server.connect(transport);API Reference
MCPDeclarativeServer
new MCPDeclarativeServer(options);Options
name(string): The name of the serverversion(string): The version of the servertools(array): An array of tool definitionsprompts(array): An array of prompt definitionsresources(array): An array of resource definitions
Tool Definition Format
[
name, // string: name of the tool
paramSchema, // object: parameter schema
handler, // function: async function to handle the tool call
description, // string (optional): description of the tool
];Prompt Definition Format
[
name, // string: name of the prompt
paramSchema, // object: parameter schema
handler, // function: async function to handle the prompt
description, // string (optional): description of the prompt
];Resource Definition Format
[
uri, // string: URI of the resource
handler, // function: async function to handle the resource request
];License
ISC
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Build your own tools from chat: design, test and host them on a shareable MCP server URL.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA boilerplate template for developing Model Context Protocol (MCP) servers, providing a structured framework for defining tools, resources, and prompts.-
- AlicenseNot gradedqualityDmaintenanceEnables developers to build and deploy secure, typed Model Context Protocol servers with tools, resources, prompts, bearer-token authentication, per-tool scopes, rate limiting, and health probes over Streamable HTTP.MIT
- AlicenseNot gradedqualityCmaintenanceEnables creating minimal Model Context Protocol servers with tools, resources, and prompts over stdio or streamable HTTP using only Python's standard library.MIT
- AlicenseNot gradedqualityAmaintenanceEnables TypeScript developers to build Model Context Protocol servers by defining tools, prompts, resources, resource templates, and roots with minimal boilerplate, using either an Express-like API or experimental decorators.31 npmMIT