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 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
- AlicenseNot gradedqualityCmaintenanceA simple implementation of a Model Context Protocol server that demonstrates core functionality including mathematical tools (add, subtract) and personalized greeting resources.93GPL 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.23ISC
Related MCP Connectors
A Model Context Protocol server for Wix AI tools
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP Spec Compliance MCP — audits any MCP server.json against the official Model Context Protocol
Appeared in Searches
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/ugundhar/mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server