MCP Server Basic Example
MCP 서버 기본 예제
이는 도구와 리소스를 포함한 핵심 기능을 보여주는 MCP(모델 컨텍스트 프로토콜) 서버 구현의 기본적인 예입니다.
설정 단계
프로젝트를 초기화합니다(로컬 폴더로 이동하여 PowerShell이나 cmd를 실행합니다):
지엑스피1
가상 환경을 생성하고 활성화하세요
uv venv
.venv\Scripts\activate종속성 설치:
uv add "mcp[cli]"또는
uv add -r requirements.txtRelated MCP server: MCP Server Basic Example
특징
서버는 다음과 같은 기능을 구현합니다.
도구
add(a: int, b: int): 두 숫자를 더합니다.subtract(a: int, b: int): 첫 번째 숫자에서 두 번째 숫자를 뺍니다.
자원
greeting://{name}: 개인화된 인사말을 반환합니다.
서버 실행
개발을 위해 MCP Inspector로 서버를 실행하려면:
uv run mcp dev main.py서버를 정상적으로 실행하려면:
uv run mcp runClaude 데스크톱 앱에 서버를 설치하려면:
uv run mcp install main.pyVS 코드에서 MCP 연결
vs 코드에서 폴더/mcp-server-basic 열기
터미널을 열고 아래 명령을 실행하세요.
uv run main.pyvs 코드에서 채팅을 시작하려면 Cntrl+Shift+I를 클릭하세요.
Github에 로그인하고 설정하세요
아래 단계를 따르세요(VS 코드 사용자 설정에 MCP 구성을 추가하는 두 가지 방법):
#mcp에서 안녕하세요
This server cannot be deployed
Maintenance
Related MCP Connectors
Model Context Protocol server for Studex tools, notifications, and profile integrations
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA simple implementation of a Model Context Protocol server that demonstrates core functionality including mathematical tools (add, subtract) and personalized greeting resources.98GPL 3.0
- AlicenseNot gradedqualityDmaintenanceA basic implementation of a Model Context Protocol server that demonstrates core functionality with simple math tools (add, subtract) and greeting resources for AI assistants like Claude.GPL 3.0
- FlicenseNot gradedqualityDmaintenanceA demonstration implementation of a Model Context Protocol server that provides simple mathematical tools (add, subtract) and personalized greeting resources.-
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides basic tools for arithmetic operations (addition) and dynamic greeting resources, demonstrating MCP integration patterns for other projects and clients.10 npmISC