MCP Declarative Server
Allows installation of the MCP server through the npm package manager with the 'mcp-client-router' package.
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 Declarative Servercreate a tool that converts temperatures between Celsius and Fahrenheit"
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 Declarative Server
A utility module for creating Model Context Protocol (MCP) servers declaratively.
Installation
npm install mcp-client-routerRelated MCP server: YA_MCPServer Template
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
This 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-qualityCmaintenanceA command-line tool for creating and running Model Context Protocol servers that expose resources, tools, and prompts to LLM clients.Last updated1931AGPL 3.0
- Flicense-qualityDmaintenanceA boilerplate template for developing Model Context Protocol (MCP) servers, providing a structured framework for defining tools, resources, and prompts.Last updated
- Alicense-qualityDmaintenanceModel Context Protocol server that standardizes tool discovery, execution, and context management for AI applications.Last updatedMIT
- Alicense-qualityDmaintenanceA toy MCP server for exploring Model Context Protocol capabilities, including resources, tools, and prompts.Last updatedApache 2.0
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for generating rough-draft project plans from natural-language prompts.
A Model Context Protocol server for Wix AI tools
Appeared in Searches
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/johnhenry/mcp-declarative-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server