math-mcp-lab
Math Lab: MCP + OpenAI Agents SDK
이 프로젝트는 두 어댑터에서 동일한 수학 로직을 사용합니다:
Codex, MCP Inspector, 또는 호환되는 모든 클라이언트를 위한 MCP 서버입니다.
자연어로 대화하기 위해 OpenAI Agents SDK로 구축된 에이전트입니다.
설치 가능한 Python 패키지(pip install -e .)로 패키징되며, src/ 레이아웃과 계층적 클린 아키텍처를 갖추고 있습니다.
구조
pyproject.toml # Metadata, dependencias y entry points del paquete
src/
└── math_assistant/
├── domain/ # Reglas matemáticas puras (sin dependencias externas)
├── application/ # Catálogo de capacidades públicas
├── infrastructure/ # Adaptadores para MCP (FastMCP) y OpenAI Agents SDK
└── presentation/ # Interfaz de terminal
tests/
├── unit/ # Prueban dominio y catálogo
└── integration/ # Comprueban que los adaptadores se construyen
run_cli.py # Entry point: interfaz amigable para aprender y probar
run_mcp.py # Entry point: STDIO exclusivo para el cliente MCP의존성은 항상 안쪽을 향합니다:
CLI / MCP / OpenAI SDK → application → domain도메인은 FastMCP, OpenAI, API key, print()를 알지 않습니다. 그래서 네트워크 없이도 빠르게 테스트할 수 있습니다.
Related MCP server: Explore MCP
설치
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"루트의 .env 파일에 OPENAI_API_KEY를 복사하세요 (git에는 절대 올라가지 않습니다).
사용자 친화적 인터페이스 실행
.\.venv\Scripts\python.exe .\run_cli.py메뉴에서는 다음을 할 수 있습니다:
OpenAI 에이전트와 대화하기 (
.env의OPENAI_API_KEY사용).덧셈, 뺄셈, 곱셈, 나눗셈을 API 비용 없이 로컬로 테스트하기.
MCP 서버가 공개하는 도구 보기.
MCP 서버 실행
.\.venv\Scripts\python.exe .\run_mcp.pyMCP Inspector로 검사하려면:
npx @modelcontextprotocol/inspector "C:\ruta\completa\a\math-mcp-lab\.venv\Scripts\python.exe" "C:\ruta\completa\a\math-mcp-lab\run_mcp.py"절대 경로를 사용하세요: Inspector는 현재 작업 디렉터리를 항상 존중하지 않습니다.
run_mcp.py 또는 MCP 어댑터 안에 print()를 추가하지 마세요. 표준 출력 채널(stdout)은 프로토콜의 JSON-RPC 메시지용으로 예약되어 있습니다. 그래서 사용자 친화적 인터페이스는 run_cli.py에 있습니다.
Codex 통합
.codex/config.toml(버전 관리되지 않는 로컬 머신 설정)은 Codex를 MCP 서버에 연결합니다. Codex CLI를 사용한다면, 자신만의 설정을 만드세요:
[mcp_servers.math]
command = "C:\\ruta\\completa\\a\\math-mcp-lab\\.venv\\Scripts\\python.exe"
args = ["C:\\ruta\\completa\\a\\math-mcp-lab\\run_mcp.py"]
cwd = "C:\\ruta\\completa\\a\\math-mcp-lab"테스트
.\.venv\Scripts\python.exe -m unittest discover -s tests -v수학 도구를 추가하는 방법
src/math_assistant/domain/operations.py에 순수 함수와 해당 docstring을 생성하세요.src/math_assistant/application/tool_catalog.py의MATH_OPERATIONS에 그것을 추가하세요.테스트를 실행하세요.
두 어댑터는 이를 자동으로 노출합니다: FastMCP는 MCP 도구로 변환하고, Agents SDK는 function tool로 변환합니다.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityDmaintenanceA learning-focused MCP server that demonstrates how to build arithmetic tools for AI assistants, currently featuring addition functionality with structured input/output.117MIT
- FlicenseNot gradedqualityDmaintenanceA demonstration MCP server that exposes basic arithmetic tools (add, subtract, ping) through FastAPI and shows how to integrate them with OpenAI's tool-calling API for LLM orchestration.
- FlicenseNot gradedqualityDmaintenanceA simple demonstration MCP server built with FastMCP that exposes basic calculator operations (add, subtract, multiply, divide) as tools for MCP clients like GitHub Copilot Agent mode.
- FlicenseAqualityDmaintenanceA basic MCP server built with the FastMCP framework that provides fundamental mathematical operations like addition, subtraction, multiplication, and division. It serves as a demonstration for integrating math-based tools into MCP-compatible environments like Cursor IDE.4
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Hosted MCP server to manage a restaurant menu from AI agents - 39 tools over the DuckHub API.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/matiasn2008/math-mcp-lab'
If you have feedback or need assistance with the MCP directory API, please join our Discord server