
pguso/mcp-from-scratch
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
일반 Node.js에서 모델 Context Protocol (MCP) 스크래치에서 알아보세요. JSON-RPC 및 stdio 운송에서 도구, 프롬프트, 리소스, ...
개요
완전한 초보자를위한 학습 저장소. 프레임 없음. 까만 상자 없음. 순수한 Node.js. 종료하면 작업 MCP 서버를 구축하여 Claude Desktop에 연결할 수 있습니다. 그리고 모든 라인을 이해할 수 있습니다. 그 모듈은 MCP가 무엇인지 설명합니다. 왜 존재하고 정신적 모델은 나중에 모듈 빌드합니다. 실제 도구를 노출하는 일반 Node.js의 완전 작업 MCP 서버는 프로토콜을 정확히 따르고 수정없이 Claude Desktop (또는 MCP 클라이언트)에 연결합니다. 당신은 조각으로 만들 것입니다. 각 단위는 1개의 질문을 대답합니다. 그 질문에 대한 답변은 다음 질문을 명백하게합니다. Module 06은 이정표입니다. Module 09 추가 (Desktop / Cursor slash 명령). 모듈 07–11 프로토콜을 완료합니다. 단위 12는 MCP를 (주문 반복 + 선택적인 LangChain) 연결합니다. 1개의 규칙: 단위 01–10 (및 단위 11's)에서. 모든 서버는 노드 src/server.js로 실행됩니다. root package.json의 유일한 항목은 "type": "module"입니다.
개요(AI 번역)
완전한 초보자를위한 학습 저장소. 프레임 없음. 까만 상자 없음. 순수한 Node.js.
종료하면 작업 MCP 서버를 구축하여 Claude Desktop에 연결할 수 있습니다. 그리고 모든 라인을 이해할 수 있습니다.
[T0]]로 시작한다. 그 모듈은 MCP가 무엇인지 설명합니다. 왜 존재하고 정신적 모델은 나중에 모듈 빌드합니다.
당신이 빌드하는 것
실제 도구를 노출하는 일반 Node.js의 완전 작업 MCP 서버는 프로토콜을 정확히 따르고 수정없이 Claude Desktop (또는 MCP 클라이언트)에 연결합니다.
당신은 조각으로 만들 것입니다. 각 단위는 1개의 질문을 대답합니다. 그 질문에 대한 답변은 다음 질문을 명백하게합니다.
Module 06은 tools 이정표입니다. Module 09 addsprompts (데스크탑 / 커서 슬래시 명령). 모듈 07–11 프로토콜을 완료합니다. Module 12은 MCP를 ** 시약 워크플로우** (custom loop + Selection LangChain)에 연결합니다.
저장소 구조
하나의 규칙: ** npm 의존 ** 모듈 01–10 (및 모듈 11’s **). 모든 서버는 node src/server.js로 실행됩니다. root package.json의 유일한 항목은 ESM 가져 오기를 가능하게하는 "type": "module"입니다.
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
MCP from Scratch
A learning repository for complete beginners. No frameworks. No black boxes. Pure Node.js.
By the end you will have built a working MCP server you can connect to Claude Desktop - and you will understand every line of it.
Start with 01-what-is-mcp/README.md. That module explains what MCP is, why it exists, and the mental model every later module builds on.
What you will build
A fully working MCP server in plain Node.js that exposes real tools, follows the protocol exactly, and connects to Claude Desktop (or any MCP client) without modification.
You will build it piece by piece. Each module answers one question. The answer to that question makes the next question obvious.
Module 06 is the tools milestone. Module 09 adds prompts (Desktop / Cursor slash commands). Modules 07–11 complete the protocol. Module 12 connects MCP to agent workflows (custom loop + optional LangChain).
Repository structure
mcp-from-scratch/
├── README.md ← you are here
├── package.json ← { "type": "module" } - that is all
├── images/ ← shared diagrams and screenshots used across modules
├── models/ ← shared GGUF cache reused by modules 11 and 12
│
├── 01-what-is-mcp/
│ ├── README.md
│ └── ANSWERS.md ← optional self-check answers; this module is docs-only
│
├── 02-json-rpc/
│ ├── README.md
│ ├── run.md
│ └── src/
│ ├── jsonrpc.js ← encode and decode messages
│ └── dispatcher.js ← route method calls to handlers
│
├── 03-stdio-transport/
│ ├── README.md
│ ├── run.md
│ └── src/
│ ├── framing.js ← buffer stdin, emit complete messages
│ ├── server.js ← reads from stdin, writes to stdout
│ └── client.js ← spawns server, sends a message, reads reply
│
├── 04-lifecycle/
│ ├── README.md
│ ├── run.md
│ └── src/
│ ├── session.js ← state machine: CREATED → INITIALIZING → READY → CLOSED
│ ├── server.js ← handles initialize, sends initialized notification
│ └── client.js ← sends initialize, waits for handshake to complete
│
├── 05-tools-list/
│ ├── README.md
│ ├── run.md
│ └── src/
│ ├── registry.js ← store tool definitions
│ ├── server.js ← handles tools/list
│ └── client.js ← calls tools/list, prints what it finds
│
├── 06-tools-call/
│ ├── README.md
│ ├── run.md ← pick run-local or run-desktop
│ ├── run-local.md ← full local checklist
│ ├── run-desktop.md ← full Desktop checklist
│ └── src/
│ ├── server.js ← handles tools/call, runs the function, returns result
│ ├── client.js ← calls a tool, prints the result
│ ├── inspector.md ← MCP Inspector (launch, connect, Claude Desktop limits)
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →