MCP LLMS-TXT 문서 서버
개요
llms.txt 는 LLM을 위한 웹사이트 인덱스로, 배경 정보, 지침, 그리고 자세한 마크다운 파일 링크를 제공합니다. Cursor, Windsurf와 같은 IDE나 Claude Code/Desktop과 같은 앱은 llms.txt 사용하여 작업의 컨텍스트를 검색할 수 있습니다. 하지만 이러한 앱은 llms.txt 와 같은 파일을 읽고 처리하기 위해 다양한 내장 도구를 사용합니다. 검색 과정은 불투명할 수 있으며, 도구 호출이나 반환된 컨텍스트를 감사할 방법이 항상 있는 것은 아닙니다.
MCP는 개발자가 이러한 애플리케이션에서 사용하는 도구를 완벽하게 제어 할 수 있는 방법을 제공합니다. 여기서는 MCP 호스트 애플리케이션(예: Cursor, Windsurf, Claude Code/Desktop)에 (1) 사용자 정의 llms.txt 파일 목록과 (2) 제공된 llms.txt 파일 내의 URL을 읽어오는 간단한 fetch_docs 도구를 제공하는 오픈 소스 MCP 서버를 llms.txt fetch_docs llms.txt 이를 통해 사용자는 각 도구 호출과 반환된 컨텍스트를 감사할 수 있습니다.
Related MCP server: mcp-browser-use
빠른 시작
uv 설치
uv설치하는 다른 방법은 공식 uv 문서를 참조하세요.
지엑스피1
사용할 llms.txt 파일을 선택하세요.
예를 들어, LangGraph
llms.txt파일은 다음과 같습니다 .
(선택 사항) 선택한 llms.txt 파일을 사용하여 MCP 서버를 로컬로 테스트합니다.
uvx --from mcpdoc mcpdoc \
--urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt \
--transport sse \
--port 8082 \
--host localhost다음에서 실행되어야 합니다: http://localhost:8082
MCP 검사기를 실행하고 실행 중인 서버에 연결합니다.
npx @modelcontextprotocol/inspector여기에서
tool호출을 테스트할 수 있습니다.
커서에 연결
Cursor Settings및MCP탭을 엽니다.~/.cursor/mcp.json파일이 열립니다.
다음을 파일에 붙여넣습니다(
langgraph-docs-mcp이름을 사용하고 LangGraphllms.txt에 연결합니다).
{
"mcpServers": {
"langgraph-docs-mcp": {
"command": "uvx",
"args": [
"--from",
"mcpdoc",
"mcpdoc",
"--urls",
"LangGraph:https://langchain-ai.github.io/langgraph/llms.txt",
"--transport",
"stdio",
"--port",
"8081",
"--host",
"localhost"
]
}
}
}Cursor Settings/MCP탭에서 서버가 실행 중인지 확인하세요.CMD+L(Mac)을 눌러 채팅을 엽니다.agent선택되었는지 확인하세요.
그런 다음, 다음과 같은 예시 프롬프트를 시도해 보세요.
use the langgraph-docs-mcp server to answer any LangGraph questions --
+ call list_doc_sources tool to get the available llms.txt file
+ call fetch_docs tool to read it
+ reflect on the urls in llms.txt
+ reflect on the input question
+ call fetch_docs on any urls relevant to the question
+ use this to answer the question
what are types of memory in LangGraph?Windsurf에 연결
CMD+L(Mac)을 눌러 Cascade를 엽니다.Configure MCP클릭하여 구성 파일~/.codeium/windsurf/mcp_config.json엽니다.위에 언급한 대로
langgraph-docs-mcp로 업데이트합니다.
CMD+L(Mac)을 눌러 Cascade를 열고 MCP 서버를 새로 고칩니다.사용 가능한 MCP 서버가 나열되고,
langgraph-docs-mcp연결된 것으로 표시됩니다.
그런 다음, 예제 프롬프트를 시도해 보세요.
도구 호출을 수행합니다.
Claude Desktop에 연결
Settings/Developer열어~/Library/Application\ Support/Claude/claude_desktop_config.json을 업데이트합니다.위에 언급한 대로
langgraph-docs-mcp로 업데이트합니다.Claude Desktop 앱을 다시 시작합니다.
채팅 입력란의 오른쪽 하단에 도구가 표시됩니다.
그런 다음, 예제 프롬프트를 시도해 보세요.
요청을 처리할 때 도구 호출을 승인할지 묻습니다.
Claude Code에 연결
Claude Code를 설치한 후 터미널에서 다음 명령을 실행하여 프로젝트에 MCP 서버를 추가합니다.
claude mcp add-json langgraph-docs '{"type":"stdio","command":"uvx" ,"args":["--from", "mcpdoc", "mcpdoc", "--urls", "langgraph:https://langchain-ai.github.io/langgraph/llms.txt"]}' -s local~/.claude.json이 업데이트된 것을 볼 수 있습니다.Claude Code를 실행하고 도구를 확인하여 테스트하세요.
$ Claude
$ /mcp 그런 다음, 예제 프롬프트를 시도해 보세요.
도구 호출을 승인할지 묻습니다.
명령줄 인터페이스
mcpdoc 명령은 문서 서버를 시작하기 위한 간단한 CLI를 제공합니다.
문서 소스를 지정하는 방법은 세 가지가 있으며, 이를 결합할 수도 있습니다.
YAML 구성 파일 사용:
이렇게 하면 이 저장소의
sample_config.yaml파일에서 LangGraph Python 문서가 로드됩니다.
mcpdoc --yaml sample_config.yamlJSON 구성 파일 사용:
이렇게 하면 이 저장소의
sample_config.json파일에서 LangGraph Python 문서가 로드됩니다.
mcpdoc --json sample_config.json선택적 이름을 사용하여 llms.txt URL을 직접 지정합니다.
URL은 일반 URL로 지정하거나
name:url형식을 사용하여 선택적 이름을 사용하여 지정할 수 있습니다.위의 MCP 서버에
llms.txt를 로드한 방법은 다음과 같습니다.
mcpdoc --urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt다음 방법을 결합하여 문서 소스를 병합할 수도 있습니다.
mcpdoc --yaml sample_config.yaml --json sample_config.json --urls https://langchain-ai.github.io/langgraph/llms.txt추가 옵션
--follow-redirects: HTTP 리디렉션을 따릅니다(기본값은 False)--timeout SECONDS: HTTP 요청 시간 초과(초) (기본값은 10.0)
추가 옵션이 있는 예:
mcpdoc --yaml sample_config.yaml --follow-redirects --timeout 15이렇게 하면 15초의 시간 제한을 두고 LangGraph Python 문서가 로드되고 필요한 경우 모든 HTTP 리디렉션을 따릅니다.
구성 형식
YAML과 JSON 구성 파일에는 모두 문서 소스 목록이 포함되어야 합니다.
각 소스에는 llms_txt URL이 포함되어야 하며 선택적으로 name 포함할 수 있습니다.
YAML 구성 예제(sample_config.yaml)
# Sample configuration for mcp-mcpdoc server
# Each entry must have a llms_txt URL and optionally a name
- name: LangGraph Python
llms_txt: https://langchain-ai.github.io/langgraph/llms.txtJSON 구성 예제(sample_config.json)
[
{
"name": "LangGraph Python",
"llms_txt": "https://langchain-ai.github.io/langgraph/llms.txt"
}
]프로그래밍 방식 사용
from mcpdoc.main import create_server
# Create a server with documentation sources
server = create_server(
[
{
"name": "LangGraph Python",
"llms_txt": "https://langchain-ai.github.io/langgraph/llms.txt",
},
# You can add multiple documentation sources
# {
# "name": "Another Documentation",
# "llms_txt": "https://example.com/llms.txt",
# },
],
follow_redirects=True,
timeout=15.0,
)
# Run the server
server.run(transport="stdio")