Skip to main content
Glama
flamekk

MCP Streamable HTTP Demo

by flamekk

TP5 MCP 스트리밍 가능 HTTP 데모

이 프로젝트는 다음 데모 목표를 재현합니다:

  • 두 가지 도구를 노출하는 MCP 서버.

  • @modelcontextprotocol/inspector를 사용한 테스트.

  • Streamable HTTP를 통해 MCP를 사용하는 LangChain/LangGraph 호환 에이전트.

  • Streamable HTTP를 통해 MCP를 사용하는 n8n AI 에이전트 설정.

중요한 보안 참고 사항

프롬프트에 붙여넣은 OpenAI 키가 채팅에 노출되었습니다. 에이전트를 실행하기 전에 해당 키를 취소하고 새 키를 생성하십시오. 새 키를 .env에 넣으십시오. 커밋하지 마십시오.

Related MCP server: SampleMCP

설정

Copy-Item .env.example .env
npm install

.env를 편집하고 다음을 설정하십시오:

OPENAI_API_KEY=your_new_key

MCP 서버 시작

npm run server

MCP 엔드포인트는 다음과 같습니다:

http://127.0.0.1:3000/mcp

상태 확인(health) 엔드포인트는 다음과 같습니다:

http://127.0.0.1:3000/health

MCP Inspector로 테스트

한 터미널에서 서버를 계속 실행하십시오:

npm run server

다른 터미널에서 Inspector CLI를 사용하여 도구 목록을 확인하십시오:

npm run inspector:list-tools

Windows에서 현재 Inspector CLI는 올바른 JSON 응답을 출력한 후 Node/libuv 어설션과 함께 종료될 수 있습니다. tools JSON에 calculate와 text_stats가 포함되어 있다면 MCP 호출 자체는 성공한 것입니다.

Inspector CLI로 도구를 호출하십시오:

npx --yes @modelcontextprotocol/inspector --cli http://127.0.0.1:3000/mcp --transport http --method tools/call --tool-name calculate --tool-arg operation=add --tool-arg "numbers=[2,3,4]"

Inspector UI를 열 수도 있습니다:

npm run inspector

그런 다음 선택하십시오:

Transport: Streamable HTTP
URL: http://127.0.0.1:3000/mcp

로컬 스모크 테스트

npm run smoke

이것은 MCP 도구 목록을 나열하고 calculate를 호출합니다.

LangChain 에이전트

서버가 실행 중이고 .env에 유효하게 교체된 OPENAI_API_KEY가 포함되어 있는지 확인하십시오.

npm run agent

사용자 지정 프롬프트:

npm run agent -- "Calcule 42 / 6 puis analyse le texte: Bonjour depuis MCP."

n8n 에이전트

docs/n8n-agent.md를 따르십시오.

n8n MCP 클라이언트 도구 구성은 다음과 같습니다:

Endpoint: http://127.0.0.1:3000/mcp
Server Transport: HTTP Streamable
Authentication: None
Tools to Include: All

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A Python-based MCP server demonstrating basic math and text tools, supporting both SSE and STDIO transports for integration with AI assistants like Cline in VS Code.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides math and weather tools accessible via LangGraph agent using MCP protocol with stdio and streamable HTTP transports.
    1
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    A calculator MCP server providing add and subtract tools, along with file resources and a code review prompt, supporting in-memory, HTTP, and STDIO transports. It also includes a LangGraph ReAct agent example that uses the tools.
    -