Skip to content

Danidfra/question-mcp

Repository files navigation

MCP Template for Deno

A template for creating Model Context Protocol (MCP) servers using Deno.

What is MCP?

The Model Context Protocol (MCP) is a standard for connecting AI models with external tools, data sources and applications. This template provides a starting point for creating your own MCP server that can extend the capabilities of AI assistants.

Features

  • Simple and extensible MCP server template
  • Built with Deno and TypeScript
  • Uses the official MCP SDK
  • Includes example tools and tests

Getting Started

Prerequisites

  • Deno installed on your system

Installation

  1. Clone this repository or use it as a template
  2. Install dependencies:
deno cache src/stdio.ts

Running the server

After modifying the template code with your own implementation:

deno task start

For development with the MCP Inspector:

deno task dev

Testing with Goose

If you have Goose installed:

deno task goose

Development

Testing

Run the tests:

deno task test

Type Checking

Check for type errors:

deno task check

Linting

Lint the code:

deno task lint

Available Commands

  • deno task start: Start the MCP server
  • deno task dev: Start the server with the MCP Inspector
  • deno task goose: Start a Goose session with this MCP
  • deno task test: Run tests
  • deno task check: Type check the code
  • deno task lint: Lint the code
  • deno task tools: List available tools
  • deno task resources: List available resources

Project Structure

/
├── src/                  # Core template source code
│   ├── AppMcpServer.ts   # Main template server
│   └── stdio.ts          # Entry point
└── tests/                # Unit tests

App Design Question Tool

This MCP includes an interactive app design preference gathering tool:

question_app_design: Gathers comprehensive app design preferences through an interactive, sequential questioning process.

  • Required parameters:

    • choose_style (boolean): Whether user wants to customize visual aspects
    • primary_platform (enum: "mobile", "desktop", "both"): Main platform for the app
    • multi_language_support (boolean): Whether app should support multiple languages
  • Parameters prompted in sequence during interaction:

    • design_style (string): User-defined design style preference
    • custom_palette (boolean): Whether user wants a custom color palette
    • palette (string[]): List of colors for the custom palette
    • color_usage_plan (string): Where to apply the selected colors
    • font_preference (string): Preferred font style
    • initial_components (string[]): Specific UI components to include
    • languages (string[]): Languages to support (if multi-language)

The tool ensures all necessary questions are asked in a logical sequence, with follow-up questions based on previous answers.

Customizing the Template

To create your own MCP server:

  1. Modify the AppMcpServer class with your desired name and version
  2. Replace or enhance the registerTools method with your custom tools
  3. Implement your tool logic
  4. Update the deno.json file with your project name

Example of customizing the template:

// src/AppMcpServer.ts
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

export class AppMcpServer extends McpServer {
  constructor() {
    // Change name and version to your own
    super({
      name: "my-custom-mcp",
      version: "1.0.0",
    });

    this.registerTools();
  }

  protected registerTools(): void {
    // Add your custom tools here
    this.tool(
      "greet",
      "Greet a person by name",
      {
        name: z.string().describe("The name of the person to greet"),
        formal: z.boolean().optional().describe("Use formal greeting style"),
      },
      async ({ name, formal }) => {
        const greeting = formal ? `Hello, ${name}.` : `Hi ${name}! 👋`;
        return {
          content: [{
            type: "text",
            text: greeting,
          }],
        };
      },
    );
  }
}

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors