MCP-llms-txt

MCP-llms-txt

Okay, I understand. You want me to: 1. Create an MCP (presumably referring to a Minecraft Protocol) server. 2. This server should be related to the project "SecretiveShell/Awesome-llms-txt". 3. I should add documentation directly into our conversation, using MCP resources (presumably meaning Minecraft Protocol resources, like packets and data structures). This is a complex request that requires significant coding and understanding of Minecraft's internal workings. I can't *actually* create and host a server for you. That requires a development environment, a Minecraft server instance, and the ability to write and execute code. However, I *can* provide you with a conceptual outline and code snippets to get you started, along with documentation integrated into our conversation. I'll focus on the core aspects of handling a connection and sending/receiving basic data. **Conceptual Outline** 1. **Server Setup:** Use a programming language like Java (the language Minecraft is written in) or Python (with a library like `mcstatus` or `nbt`) to create a server socket that listens for incoming connections on a specific port (e.g., 25565, the default Minecraft port). 2. **Handshake:** The Minecraft client initiates a handshake. You need to parse this handshake packet to determine the protocol version and the intended server state (status or login). 3. **Status/Login:** * **Status:** If the client requests status, you send back a JSON response containing server information (MOTD, player count, etc.). * **Login:** If the client requests login, you handle authentication (if required) and then transition the client to the play state. 4. **Play State:** This is where the core game logic happens. You receive packets from the client (e.g., movement, chat messages) and send packets back to the client (e.g., world updates, entity positions). **Simplified Code Snippet (Python using `socket` - for demonstration only, not a full MCP implementation):** ```python import socket import json HOST = '127.0.0.1' # Standard loopback interface address (localhost) PORT = 25565 # Minecraft default port with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.bind((HOST, PORT)) s.listen() print(f"Server listening on {HOST}:{PORT}") conn, addr = s.accept() with conn: print(f"Connected by {addr}") while True: data = conn.recv(1024) # Receive up to 1024 bytes if not data: break print(f"Received: {data}") # **VERY SIMPLIFIED HANDSHAKE EXAMPLE (DOES NOT PARSE PROPERLY)** if b'\x00\x04' in data: # Crude check for a handshake-like packet print("Possible Handshake detected") # **IN REALITY, YOU NEED TO PARSE THE VARINTS AND DATA PROPERLY** # Example Status Response (Simplified) status_response = { "version": {"name": "My Awesome Server", "protocol": 757}, "players": {"max": 100, "online": 10, "sample": []}, "description": {"text": "A server for Awesome-llms-txt!"} } json_response = json.dumps(status_response) # **IMPORTANT: Minecraft requires a VarInt length prefix before the JSON** # **This is a placeholder - you need to implement VarInt encoding** length_prefix = len(json_response).to_bytes(1, 'big') # Incorrect VarInt encoding conn.sendall(length_prefix + json_response.encode('utf-8')) else: conn.sendall(b"Received your data!") # Echo back (for testing) ``` **Explanation and MCP Documentation Integration** * **`socket.socket(socket.AF_INET, socket.SOCK_STREAM)`:** Creates a TCP socket. TCP is the protocol Minecraft uses. This corresponds to the underlying network layer. * **`s.bind((HOST, PORT))`:** Binds the socket to a specific IP address and port. * **`s.listen()`:** Starts listening for incoming connections. * **`conn, addr = s.accept()`:** Accepts a connection. `conn` is a new socket object for communicating with the client, and `addr` is the client's address. * **`conn.recv(1024)`:** Receives data from the client. The `1024` is the maximum number of bytes to receive at once. * **Handshake (MCP Relevant):** The handshake is the first packet sent by the client. It contains: * **Packet ID (VarInt):** `0x00` for handshake. * **Protocol Version (VarInt):** The Minecraft protocol version the client is using. This is *crucial* for compatibility. 757 is for 1.17.1. You *must* handle different protocol versions. * **Server Address (String):** The address the client connected to. * **Server Port (Unsigned Short):** The port the client connected to. * **Next State (VarInt):** `1` for status, `2` for login. **VarInt Encoding:** A VarInt is a variable-length integer. It uses one or more bytes to represent an integer. Each byte (except the last) has its most significant bit set to 1. The lower 7 bits of each byte are used to store the integer's value. This is a *critical* part of the Minecraft protocol. The example code *incorrectly* uses `len(json_response).to_bytes(1, 'big')` which is *not* a VarInt. You need a proper VarInt encoding function. ```python def encode_varint(number): buf = [] while True: byte = number & 0x7F # Get the lowest 7 bits number >>= 7 if number: byte |= 0x80 # Set the MSB to indicate more bytes buf.append(byte) if not number: break return bytes(buf) ``` * **Status Response (MCP Relevant):** The status response is a JSON string that contains server information. The JSON is *prefixed* with a VarInt indicating the length of the JSON string. The structure of the JSON is defined by the Minecraft protocol. The example code provides a simplified version. **Next Steps and Considerations** 1. **VarInt Implementation:** Implement proper VarInt encoding and decoding. This is essential for handling all packets. 2. **Packet Parsing:** Implement proper packet parsing based on the protocol version. Use a library or write your own code to read VarInts, strings, and other data types from the byte stream. 3. **Protocol Version Handling:** Support multiple Minecraft protocol versions. This is a *major* undertaking, as the protocol changes frequently. You'll need to maintain a mapping of protocol versions to packet structures. 4. **Authentication:** Implement authentication if you want to require players to log in with a Minecraft account. This involves interacting with Mojang's authentication servers. 5. **Game Logic:** Implement the core game logic for your server. This will involve handling player movement, world updates, and other game events. 6. **NBT Data:** Minecraft uses Named Binary Tag (NBT) format for storing world data, player data, and other complex data structures. You'll need a library to read and write NBT data. 7. **Asynchronous Handling:** Use asynchronous programming (e.g., `asyncio` in Python) to handle multiple clients concurrently. This is a very high-level overview. Building a Minecraft server from scratch is a significant project. Start with the basics (handshake and status) and gradually add more features. Good luck! Let me know if you have more specific questions. I can provide more detailed code snippets and explanations for specific parts of the protocol.

远程shell执行
编程文档访问
AI集成系统
访问服务器

README

mcp-llms-txt

smithery badge

用于 Awesome-llms-txt 的 MCP 服务器。 通过 mcp 资源直接将文档添加到您的对话中。

<a href="https://glama.ai/mcp/servers/kqwhhpe8l7"><img width="380" height="200" src="https://glama.ai/mcp/servers/kqwhhpe8l7/badge" alt="MCP-llms-txt MCP server" /></a>

安装

pulsemcp.com 上查看设置指南 + 示例用法

通过 Smithery 安装

要通过 Smithery 为 Claude Desktop 自动安装 Awesome-llms-txt 的 MCP 服务器:

npx -y @smithery/cli install @SecretiveShell/MCP-llms-txt --client claude

手动安装

像这样设置您的 claude 配置:

{
    "mcpServers": {
        "mcp-llms-txt": {
            "command": "uvx",
            "args": ["mcp-llms-txt"],
            "env": {
                "PYTHONUTF8": "1"
            }
        }
    }
}

测试

使用 mcp-cli 测试服务器:

npx -y "@wong2/mcp-cli" -c config.json

配置文件已经设置好,不需要更改,因为没有 api 密钥或秘密。

贡献

欢迎贡献! 请打开一个 issue 或提交一个 pull request。

许可证

该项目根据 MIT 许可证获得许可。

推荐服务器

Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
AIO-MCP Server

AIO-MCP Server

🚀 集成了 AI 搜索、RAG 和多服务(GitLab/Jira/Confluence/YouTube)的一体化 MCP 服务器,旨在增强 AI 驱动的开发工作流程。来自 Folk。

精选
本地
https://github.com/Streen9/react-mcp

https://github.com/Streen9/react-mcp

react-mcp 与 Claude Desktop 集成,能够根据用户提示创建和修改 React 应用程序。

精选
本地
MCP Atlassian

MCP Atlassian

适用于 Atlassian Cloud 产品(Confluence 和 Jira)的 Model Context Protocol (MCP) 服务器。此集成专为 Atlassian Cloud 实例设计,不支持 Atlassian Server 或 Data Center 部署。

精选
any-chat-completions-mcp

any-chat-completions-mcp

将 Claude 与任何 OpenAI SDK 兼容的聊天完成 API 集成 - OpenAI、Perplexity、Groq、xAI、PyroPrompts 等。

精选
Exa MCP Server

Exa MCP Server

一个模型上下文协议服务器,它使像 Claude 这样的人工智能助手能够以安全和受控的方式,使用 Exa AI 搜索 API 执行实时网络搜索。

精选