week7-mcp-server
7주차 — MCP (에이전트에게 자체 도구를 제공하는 표준 방식)
AI로 전환되는 필드 속에서 자동화 역량을 키우는 제 여정의 일부입니다. 이번 주는 Model Context Protocol (MCP) 입니다 — 프롬프트에 데이터를 붙여넣는 대신, LLM은 작은 도구 세트를 받고 질문에 답하기 위해 어떤 도구를 어떤 순서로 호출할지 스스로 결정합니다.
이번 주가 중요한 이유: 프롬프트에 데이터를 하드코딩하면 데모 이상은 진행할 수 없습니다. MCP는 '여기 도구와 데이터 소스가 있으니 실행하라'는 흐름의 표준으로 자리 잡고 있습니다. 에이전트가 스냅샷이 아닌 실시간 시스템에 연결할 수 있게 해줍니다.
아키텍처
[client.py asks a question]
|
v
[Claude sees 3 tool definitions — no invoice data in the prompt]
| decides which tools to call, with what arguments
v
[MCP server (server.py): list_invoices / get_invoice / get_purchase_order]
| returns live data over stdio
v
[Claude reasons over the results and answers]연속성: 2주차에서는 문서에서 인보이스를 추출했습니다. 6주차에는 봇이 이미 가지고 있던 데이터로 인보이스 예외 처리 방향을 결정했습니다. 이번 주에는 데이터 자체가 MCP 서버 뒤에 있습니다 — 에이전트는 데이터를 받으러 가는 대신 스스로 정보를 가져옵니다. 이번 주를 7주차의 정책 검증적 결정 서비스와 연결하면 로드맵의 포트폴리오 프로젝트 #4 즉, 무언가를 조회하면서 판단은 감사 가능한 규칙 계층에 맡기는 에이전트가 됩니다.
Related MCP server: Invoice MCP Server
무슨 내용
파일 | 역할 |
| MCP 서버 — |
| 서버를 생성하고 Claude에서 실행 — 서버 프로세스를 별도로 시작할 필요 없음 |
| 도구 함수의 유닛 테스트 — API 키 불필요 |
1. 실행하기
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
# copy .env.example to .env and paste your key
python src/client.pyclient.py는 server.py를 stdio로 직접 생성합니다(MAC는 로컬 도구에서
일반적으로 동작하는 방식이며, 7주차와 달리 HTTP 포트를 관리할 필요가 없습니다).
[MCP tool call: ...] 줄이 Claude가 무엇을 조회해야 할지 판단하면서 출력되는
것을 확인해 보세요.
도구 로직의 유닛 테스트 실행(API 키는 불필요):
pytest2. 핵심 설계 아이디어: 표준 프로토콜 위에 올린 도구와 데이터
MCP 이전에는 "모델에 도구를 주는 것"은 매 프로젝트마다 JSON 스키마와 디스패치
if/elif를 직접하는 것을 뜻했습니다. MAC는 이를 표준화합니다. server.py가
@mcp.tool()로 도구를 한 번 선언하면, MCP를 말하는 클라이언트 — 이 저장소의
client.py, Claude Desktop, 다른 툴팀의 사용자 — 모두 같은 방식으로 발견하고
호출할 수 있습니다. 이것이 "에이전트를 결제 도구에 연결한다"라는 표현의 핵심입니다.
도구를 제공하는 쪽과 에이전트가 반드시 같은 사람이 만든 일부는 아닙니다.
3. 배운 것 / 프로덕션 사용 준비
MCP는 데이터를 소유하는 곳과 데이터를 추론하는 곳을 분리합니다. 서버는 어떤 LLM이 호출하는지 알지 못하고 신경도 쓰지 않습니다.
모델 선택도 여기 중요합니다. 이 차이는 어려운 판단보다는 어떤 도구를 호출할지를 결정하는 조정각(오케스트레이션)이므로,
claude-haiku-4-5같은 사양 모델이 적절한 선택입니다. Opus급 추론은 6차차가 하는 방식의 판단을 위해 아껴두세요.프로덕션 준비는 안 됨: 'ERP'는 인메모리 dict이고 서버에 인증이 없으며 실제 MCP 리소스도 없습니다 (도구만 있는 것). 프로덕성이면 인보이스 기록도 MCP 리소스로 제공할 것입니다. (8주차 이상.)
스택
언어 · MCP (공식 Python SDK) · Claude (
claude-haiku-4-5for driving Assign) · Anthropic SDK · pytest
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
- FlicenseBqualityBmaintenanceBridges to a simple_invoicing FastAPI backend, exposing invoice, product, ledger, inventory, buyer, and payment management as MCP tools for use with MCP-compatible clients.15
- AlicenseNot gradedqualityDmaintenanceEnables invoice management through MCP, including customer, invoice, and report operations with CLI and web interfaces.MIT
- AlicenseNot gradedqualityAmaintenanceEnables agents to generate, track, and manage invoices via MCP tools, with CLI support for payment tracking and earnings summaries.MIT
- AlicenseNot gradedqualityCmaintenanceA lightweight, local inventory-intelligence MCP server that enables querying structured inventory schemas with read-only, zero-config tools for stock levels, velocity metrics, and purchase orders.10MIT
Related MCP Connectors
A paid remote MCP for CLI tool MCP, built to return verdicts, receipts, usage logs, and audit-ready
Hosted MCP server for Mini Accountant: invoices, expenses, customers, analytics, tax estimates.
A paid remote MCP for hosted MCP server, built to return verdicts, receipts, usage logs, and audit-r
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/m-rocafort/week7-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server