ravi-mcp-server

racho8/ravi-mcp-server

3.2

If you are the rightful owner of ravi-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A Go-based MCP server wrapper providing a unified interface for microservice interaction, designed for Google Cloud Run.

Tools
7
Resources
0
Prompts
0

Ravi MCP Server

This project is a simple example of a Model Context Protocol (MCP) server for product management. It lets you use easy, standard requests (JSON-RPC 2.0) to list, add, update, or delete products.

The server connects AI agents or other programs to a product microservice, making it easier to manage product data automatically or through natural language commands. This proof-of-concept shows how MCP can help organize and automate product management tasks.

API Version: v1.0.0

See for a full API reference, including all methods, required parameters, and example payloads. If you change the API, increment the version and update the documentation.

Overview

This project implements a MCP wrapper server using the Model Context Protocol (MCP) that allows AI agents to interact with a microservice called product service that provides the product data.

It provides tools for:

  • Listing available products
  • Creating, updating, and deleting products
  • Bulk product operations
  • Health check and welcome message
Architecture Diagram

Architecture Diagram

How to Run the Remote MCP Server with GitHub Copilot Agent

  1. Clone the repository and open it in VSCode.

     git clone https://github.com/racho8/ravi-mcp-server.git
     cd <repository_name>
     code .
    
  2. Setup Configuration Files

    Copy mcp.json and payload.json from docs/configuration to a new folder called .vscode in your repository.

    mkdir .vscode
    cp docs/configuration/mcp.json .vscode/
    cp docs/configuration/payload.json .vscode/
    
  3. Start the MCP Server

    Start the ravi-mcp-server by clicking the start button in the mcp.json file in vscode.

    Note: Sometime, it might show as Error next to the server, but it still works.

  4. Export GCP Authentication Token (Very Important, otherwise it won't work)

    Run the following command to export your GCP authentication token.

    export gcp_auth_token=$(gcloud auth print-identity-token)
    

    Note: Ensure your account has the Cloud Run Invoker role (contact the repository owner if unsure).

  • Test with GitHub Copilot Chat in Agent Mode

    Open GitHub Copilot chat in agent mode and test with the following natural language commands:

Use the remote ravi-mcp-server endpoint in mcp.json to list all tools by sending a tools/list request. Then you can fire nlp querries like:

   - show me all the available tools
   - Show all the products
   - List all products under Electronics category
   - Increment the price of all the products under Electronics category by 2%
   - Round up the price of all the products under Laptops segment to nearest 100

The agent should automatically generate and execute the corresponding cURL requests in the background and display the results.

  • Hack(Optional): If the agent asks you to run the cURL command everytime you give ask a question, you can give below prompt to bypass it:

    Prompt: Automatically generate and execute the required cURL requests in the background for any command I provide related to ravi-mcp-server. Display the results directly in plain text format, structured as well-organized tables or lists for better readability. Do not ask for approval before executing each and every cURL command.

Installation

Manual Installation

Prerequisites

  • Go 1.23+
  • Access to a product microservice (ask repo owner for MICROSERVICE_URL)

Setup

  1. Clone this repository
  2. Install dependencies:
go mod download
  1. Set environment variables:

Note: Contact repository owner for MICROSERVICE_URL and GCP authentication token.

export MICROSERVICE_URL="<your_microservice_url>"
export gcp_auth_token=$(gcloud auth print-identity-token)
export PORT=8080
  1. Run the server:
go run main.go
# or
go run .
  1. Test health endpoint:
curl http://localhost:8080/health
  1. Use /mcp endpoint for JSON-RPC requests (see tests/test_commands.sh for examples)

Available Tools

  • list_products — List all products
  • create_product — Add a new product
  • get_product — Get product details by ID
  • update_product — Update product by ID
  • delete_product — Delete product by ID
  • create_multiple_products — Add multiple products
  • update_products — Update multiple products
  • delete_products — Delete multiple products
  • health_check — Check server status
  • welcome_message — Get welcome message

Troubleshooting

Show details

If you encounter issues while running the mcp server in local:

  1. Ensure your MICROSERVICE_URL is correct and accessible
  2. Check Go version (should be 1.23+)
  3. Review error messages in server logs

Best Practices for Natural Language Querying

Show details

To smoothly query and see results in natural language, follow these steps before interacting with the MCP server:

  1. Export your GCP authentication token:
 export gcp_auth_token=$(gcloud auth print-identity-token)
 (Make sure you get necessary roles assigned to your token, contact repo owner if unsure)
  1. Set the context for your agent (e.g., GitHub Copilot agent chat):

Prompt: Whenever I ask you about a tool in ravi-mcp-server, I want you to automatically generate and execute the corresponding cURL requests asynchronously in the background, actively displaying the results in plain text format, preferably structured as well-organized tables or lists for enhanced readability. No prior approval of individual cURL commands is necessary prior to execution.

  1. Use natural language commands to query the MCP server. Example commands:
  • show me all the available tools
  • Show all the products
  • List all products under Electronics category
  • Increment the price of all the products under Electronics category by 3%
  • Round up the price of all the products under Laptops segment to nearest 100