Skip to main content
Glama

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

메뉴에서는 다음을 할 수 있습니다:

  1. OpenAI 에이전트와 대화하기 (.envOPENAI_API_KEY 사용).

  2. 덧셈, 뺄셈, 곱셈, 나눗셈을 API 비용 없이 로컬로 테스트하기.

  3. MCP 서버가 공개하는 도구 보기.

MCP 서버 실행

.\.venv\Scripts\python.exe .\run_mcp.py

MCP 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

수학 도구를 추가하는 방법

  1. src/math_assistant/domain/operations.py에 순수 함수와 해당 docstring을 생성하세요.

  2. src/math_assistant/application/tool_catalog.pyMATH_OPERATIONS에 그것을 추가하세요.

  3. 테스트를 실행하세요.

두 어댑터는 이를 자동으로 노출합니다: FastMCP는 MCP 도구로 변환하고, Agents SDK는 function tool로 변환합니다.

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • F
    license
    Not graded
    quality
    D
    maintenance
    A 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.
  • F
    license
    Not graded
    quality
    D
    maintenance
    A 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.
  • F
    license
    A
    quality
    D
    maintenance
    A 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

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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