Related MCP Server Resources

Explore more AI models, providers, and integration options:

  • Explore AI Models
  • Explore AI Providers
  • Explore MCP Servers
  • LangDB Pricing
  • Documentation
  • AI Industry Blog
  • Git Spice Help MCP Server
  • Image Processor MCP Server
  • MCP Server
  • MCP Sumo Logic Server
  • Image Generator MCP Server
Back to MCP Servers
MCP Declarative Server

MCP Declarative Server

Public
johnhenry/mcp-declarative-server

Declaratively create and manage Model Context Protocol servers with customizable tools, prompts, and resources for streamlined asynchronous handling and integration.

javascript
0 tools
May 30, 2025
Updated Jun 4, 2025

Supercharge Your AI with MCP Declarative Server

MCP Server

Unlock the full potential of MCP Declarative Server through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.

Unified API Access
Complete Tracing
Instant Setup
Get Started Now

Free tier available • No credit card required

Instant Setup
99.9% Uptime
10,000+Monthly Requests

MCP Declarative Server

A utility module for creating Model Context Protocol (MCP) servers declaratively.

Installation

npm install mcp-client-router

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 server
  • version (string): The version of the server
  • tools (array): An array of tool definitions
  • prompts (array): An array of prompt definitions
  • resources (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

Publicly Shared Threads0

Discover shared experiences

Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!

Share your threads to help others
Related MCPs5
  • Git Spice Help MCP Server
    Git Spice Help MCP Server

    Provides Model Context Protocol integration with Cursor IDE for real-time git-spice documentation se...

    1 tools
    Added May 30, 2025
  • Image Processor MCP Server
    Image Processor MCP Server

    A TypeScript-based Model Context Protocol server enabling creation, access, and summarization of tex...

    2 tools
    Added May 30, 2025
  • MCP Server
    MCP Server

    Provides greeting-related tools, resources, and prompts via Model Context Protocol (MCP), enabling p...

    Added May 30, 2025
  • MCP Sumo Logic Server
    MCP Sumo Logic Server

    Model Context Protocol server integrating with Sumo Logic API to perform customizable log searches w...

    Added May 30, 2025
  • Image Generator MCP Server
    Image Generator MCP Server

    Generates and saves AI-created images using Replicate's Stable Diffusion model with customizable pro...

    3 tools
    Added May 30, 2025