mcp-server-with-json-rpc

anupvr/mcp-server-with-json-rpc

3.2

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

This project is a working implementation of a Model Context Protocol (MCP) Server designed for goal-based routing using advanced technologies like JSON-RPC 2.0, Open Agent JSON, and LLM-based summarizers.

MCP Server (Goal-Based Routing)

This project is a working implementation of an MCP (Model Context Protocol) Server using:

  • JSON-RPC 2.0
  • Open Agent JSON
  • Real-time Tavily search agents (Amazon, Flipkart, TataCliq)
  • LLM-based summarizer and recommender (using OpenAI + LangChain)
  • Observability via LangSmith

How to Run

  1. Install requirements
pip install -r requirements.txt
  1. Create .env file with:
OPENAI_API_KEY=your-openai-key
TAVILY_API_KEY=your-tavily-key
  1. Start the server
python main.py
  1. Open in browser: http://localhost:8000/docs

Sample Request

{
  "jsonrpc": "2.0",
  "method": "mcp.infer",
  "params": {
    "input": "Recommend me a budget phone",
    "goal": "product_recommendation"
  },
  "id": "001"
}

Folder Structure

  • main.py — FastAPI entry
  • router.py — routes goal to agents
  • agents/ — web crawlers + LLM agents
  • utils/ — Tavily and LLM helpers
  • models/ — schemas for requests