mcpField
M
MCP Server Coding Demo Guide

MCP Server Coding Demo Guide

Local
github.com/kahunamDeveloper Tools0Updated 89w ago

About MCP Server Coding Demo Guide

MCP Server Coding Demo Guide is a practical walkthrough for building and configuring a basic MCP server with a third-party API. It guides developers through tool setup, API authorization, building, chat-app configuration, and testing.

Key features

  1. 01Review template and API demo source
  2. 02Choose and configure an API
  3. 03Define server tools and parameters
  4. 04Build with npm scripts
  5. 05Configure a chat app connection
  6. 06Test the server

Use cases

  1. 01Turn an API endpoint into an MCP tool
  2. 02Configure API keys and request headers
  3. 03Connect a built server to a chat app

MCP support

The guide explains how to create an MCP server that calls an API and makes its capability available as a tool to a chat application.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP Server Coding Demo Guide

Step 1: Clone the Repository

  1. Create a folder on your device where you'll store your MCP servers to stay organized.
  2. Clone the repository into that folder.

Step 2: Review the Source Files

  • Navigate to the src folder and review the following files:
    • index.ts: A basic template server that requires modifications.
    • demo.ts: A functional example that demonstrates an API integration.

Step 3: Select an API

  1. Go to RapidAPI and find an API and endpoint to use.
  2. Get access and your autorization key. Review the example output to understand how the request should be structured.
  3. Ensure you retrieve the correct headers, authorization details, and request parameters.

Note: Suggested to use an API with good ratings and clear output. To be sure that it's reliable.

Step 4: Configure Your Demo

  1. Define the server name - choose something which will be easy for you or an end user to recognise.
  2. Define Your Tool: Choose a name that makes sense for your use case. Collect parameters, and mark them as required if they are needed.
  3. Configure the Resource:
    • Ensure the API is properly called. Configure your authorization headers and endpoint url.
    • Pass the correct data in with the request.
    • Note - handle authentication correctly (either within the MCP configuration or a .env file).

Step 5: Install and Build

  1. Install dependencies if not already installed:
    npm install
    npm run build
    

Step 6: Configure Your Chat App

  1. Use the example configuration as your base and edit the following:
    • Build path to match your build file location.
    • Set an appropriate tool name.
    • Ensure the command is correct.
    • Insert your API key as an ENV value.
  2. Save the configuration file for your cloud desktop or 5ier setup.
  • ~/Library/Application Support
  1. Restart the chat application to apply the changes.
{
  "stock": {
    "command": "node",
    "args": ["users/mcp-servers/mcp-server-demo-1/build/demo.js"],
    "env": {
      "RAPIDAPI_KEY": "XXX-XXX-XXX-XXX-XXX-XXX-XXX-XXX-XXX"
    },
    "disabled": false,
    "autoApprove": []
  }
}

Step 8: Test Your Setup

  • Launch a chat and verify that your server is working as expected.

Debugging and Troubleshooting

Help!

Setting up MCP on Claude Desktop (user guide)
https://modelcontextprotocol.io/quickstart/user

Making an MCP server quickstart guide (dev guide)
https://modelcontextprotocol.io/quickstart/server

MCP 101 and building an MCP Server
https://glama.ai/blog/2024-11-25-model-context-protocol-quickstart

TS MCP SDK
https://github.com/modelcontextprotocol/typescript-sdk

5ire - How to add MCP to 5ire

Not feeling confident with the code? - Consider the Cline Way

Additional Notes

  • Links to specific debugging resources and chat app configurations will be added.
  • MCP servers can be deployed and tested directly within Klein.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.