Skip to content

Rohitw3code/MCP-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Math MCP Server (Python)

गणित MCP सर्वर (Python)

A simple Model Context Protocol (MCP) server for mathematical operations, written in Python.

Python में लिखा गया एक सरल Model Context Protocol (MCP) सर्वर जो गणितीय operations करता है।

Features / विशेषताएं

यह server निम्नलिखित गणितीय operations प्रदान करता है:

  • add - दो संख्याओं को जोड़ें (Add two numbers)
  • subtract - दो संख्याओं को घटाएं (Subtract two numbers)
  • multiply - दो संख्याओं को गुणा करें (Multiply two numbers)
  • divide - दो संख्याओं को भाग दें (Divide two numbers)
  • power - किसी संख्या की घात निकालें (Calculate power)
  • sqrt - वर्गमूल निकालें (Calculate square root)
  • factorial - फैक्टोरियल निकालें (Calculate factorial)
  • modulo - शेषफल निकालें (Calculate modulo/remainder)

Installation / इंस्टालेशन

आवश्यकताएं (Requirements)

  • Python 3.10 या उससे ऊपर
  • pip package manager

स्टेप्स (Steps)

  1. Dependencies install करें:
pip install -r requirements.txt

या (or):

pip install mcp

Usage / उपयोग

Server चलाना (Running the Server)

python server.py

Claude Desktop के साथ Configure करना

अपनी Claude Desktop configuration file में यह add करें:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "math": {
      "command": "python",
      "args": ["/absolute/path/to/math-mcp-server-python/server.py"]
    }
  }
}

नोट: /absolute/path/to/math-mcp-server-python/ को अपने actual path से replace करें।

Examples / उदाहरण

Server connect होने के बाद, आप Claude से ये सवाल पूछ सकते हैं:

  • "5 और 3 को जोड़ो" / "Add 5 and 3"
  • "12 को 4 से भाग दो" / "Divide 12 by 4"
  • "2 की घात 8 क्या है?" / "What is 2 to the power of 8?"
  • "144 का वर्गमूल क्या है?" / "What's the square root of 144?"
  • "5 का factorial क्या है?" / "What is the factorial of 5?"
  • "17 mod 5 क्या है?" / "What is 17 mod 5?"

API Documentation

Available Tools

add

{
    "a": number,  # पहली संख्या / First number
    "b": number   # दूसरी संख्या / Second number
}

Returns: a + b का योग

subtract

{
    "a": number,  # पहली संख्या / First number
    "b": number   # दूसरी संख्या / Second number
}

Returns: a - b का अंतर

multiply

{
    "a": number,  # पहली संख्या / First number
    "b": number   # दूसरी संख्या / Second number
}

Returns: a × b का गुणनफल

divide

{
    "a": number,  # अंश / Numerator
    "b": number   # हर / Denominator
}

Returns: a ÷ b का भागफल Error: अगर b = 0 है तो error / Error if b is 0

power

{
    "base": number,      # आधार संख्या / Base number
    "exponent": number   # घातांक / Exponent
}

Returns: base^exponent

sqrt

{
    "value": number  # संख्या / Number
}

Returns: √value (वर्गमूल) Error: अगर value ऋणात्मक है तो error / Error if value is negative

factorial

{
    "n": integer  # धनात्मक पूर्णांक / Non-negative integer
}

Returns: n! (factorial) Error: अगर n ऋणात्मक है तो error / Error if n is negative

modulo

{
    "a": number,  # भाज्य / Dividend
    "b": number   # भाजक / Divisor
}

Returns: a mod b (शेषफल / remainder) Error: अगर b = 0 है तो error / Error if b is 0

Code Structure / कोड संरचना

math-mcp-server-python/
├── server.py           # मुख्य server code
├── requirements.txt    # Python dependencies
├── pyproject.toml     # Project configuration
└── README.md          # यह file / This file

Troubleshooting / समस्या निवारण

अगर server नहीं चल रहा है:

  1. Check करें कि Python 3.10+ installed है: python --version
  2. Dependencies install हैं या नहीं: pip list | grep mcp
  3. File path सही है या नहीं Claude config में

अगर tools दिख नहीं रहे:

  1. Claude Desktop को restart करें
  2. Configuration file में proper JSON syntax है या नहीं check करें
  3. Absolute path use कर रहे हैं या नहीं verify करें

License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages