{
  "markdown": "# DSR MCP Server\n![License](https://img.shields.io/github/license/grupo-avispa/dsr_mcp_server)\n[![Build](https://github.com/grupo-avispa/dsr_mcp_server/actions/workflows/build.yml/badge.svg)](https://github.com/grupo-avispa/dsr_mcp_server/actions/workflows/build.yml)\n\nAn MCP (Model Context Protocol) server that provides a comprehensive set of tools to query, manipulate, and analyze Deep State Representation (DSR) graphs. This server enables AI assistants to interact with robot perception and scene understanding data through standardized MCP tools with real-time graph operations and intelligent node relationship management.\n\n### Tools\n\n| Tool Name                 | Description                                                                   | Parameters                                                                                                               |\n| ------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |\n| **check_dsr_connection**  | Check DSR connection and return status information                            | —                                                                                                                        |\n| **get_all_nodes**         | Retrieve all nodes from the DSR graph                                         | —                                                                                                                        |\n| **get_nodes_by_type**     | Filter nodes by their type (e.g., robot, person, room)                        | `node_type: str`                                                                                                         |\n| **get_node_details**      | Get detailed information about a specific node including attributes and edges | `node_identifier: str`                                                                                                   |\n| **get_all_edges**         | Retrieve all edges from the DSR graph                                         | —                                                                                                                        |\n| **insert_node**           | Insert a new node into the DSR graph                                          | `name: str`, `node_type: str`                                                                                            |\n| **insert_edge**           | Insert a new edge between two nodes in the DSR graph                          | `origin_id: str`, `destination_id: str`, `edge_type: str`                                                                |\n| **insert_edge_attribute** | Insert or update an attribute for an edge in the DSR graph                    | `origin_id: str`, `destination_id: str`, `attribute_name: str`, `attribute_value: str`, `attribute_type: str = 'string'` |\n| **update_node**           | Update a node with new attributes in the DSR graph                            | `node_id: str`, `attribute_name: str`, `attribute_value: str`, `attribute_type: str = 'string'`                          |\n| **delete_node**           | Delete a node from the DSR graph                                              | `node_id: str`                                                                                                           |\n| **delete_edge**           | Delete an edge from the DSR graph                                             | `origin_id: str`, `destination_id: str`, `edge_type: str`                                                                |\n| **save_graph**            | Save the current state of the DSR graph to a JSON file                        | Interactive file path selection                                                                                          |\n\n### Resources\n\nResources provide read-only, efficient access to DSR graph data. They are ideal for querying information without modifying the graph state.\n\n| Resource URI                | Description                                                  | Returns                                                 |\n| --------------------------- | ------------------------------------------------------------ | ------------------------------------------------------- |\n| **dsr://nodes**             | All nodes in the DSR graph with basic information            | JSON with nodes array, count, and DSR name              |\n| **dsr://nodes/type/{type}** | Nodes filtered by type with full details (attributes, edges) | JSON with detailed nodes array, count, and type         |\n| **dsr://nodes/{node_id}**   | Detailed information about a specific node                   | JSON with node details, attributes, and connected edges |\n| **dsr://edges**             | All edges in the DSR graph                                   | JSON with edges array, count, and DSR name              |\n\n## Environment Variables\n\n| Variable       | Default    | Description                                |\n| -------------- | ---------- | ------------------------------------------ |\n| `DSR_AGENT_ID` | 42         | Unique agent identifier for DSR connection |\n| `DSR_NAME`     | mcp_server | Target DSR graph name to connect to        |\n| `SERVER_HOST`  | 127.0.0.1  | Server host address                        |\n| `SERVER_PORT`  | 3000       | Server port number                         |\n\n## Installation\n\n### Dependencies\n\n- **[fastmcp](https://github.com/jlowin/fastmcp)**: MCP server framework (>= 2.2.7)\n- **[Cortex](https://github.com/grupo-avispa/cortex)**: DSR library for graph operations\n- **Python**: 3.12+ required\n\n> **Note:** You must build Cortex inside the virtual environment to ensure compatibility.\n```bash\ncd dsr_mcp_server\nsource .venv/bin/activate\ncd ${CORTEX_DIR} && make -p build && cd build\ncmake .. && make -j$(nproc) && sudo make install\n```\n\n### Install with uv (recommended)\n\nClone the repository and install with uv:\n\n```bash\ngit clone https://github.com/grupo-avispa/dsr_mcp_server.git\ncd dsr_mcp_server\nuv sync\n```\n\nOr install directly from the repository:\n\n```bash\nuv add git+https://github.com/grupo-avispa/dsr_mcp_server.git\n```\n\n### Install with pip\n\nInstall the package in mode:\n\n```bash\ngit clone https://github.com/grupo-avispa/dsr_mcp_server.git\ncd dsr_mcp_server\npython3 -m pip install .\n```\n\nOr install directly from the repository:\n\n```bash\npython3 -m pip install git+https://github.com/grupo-avispa/dsr_mcp_server.git\n```\n\n## Usage\n\n### Running with uv\n\n```bash\nuv run dsr_mcp_server\n```\n\n### Running with pip installation\n\n```bash\npython3 -m dsr_mcp_server\n```\n\nThe server will start and attempt to initialize the DSR connection automatically using the configured parameters.\n\n### Configuration example for Claude Desktop/Cursor/VSCode\n\n#### Using uv (recommended)\n\nAdd this configuration to your application's settings (mcp.json):\n\n```json\n{\n  \"dsr mcp server\": {\n    \"type\": \"stdio\",\n    \"command\": \"uv\",\n    \"args\": [\n      \"run\",\n      \"--directory\",\n      \"/path/to/dsr_mcp_server\",\n      \"dsr_mcp_server\"\n    ],\n    \"env\": {\n      \"DSR_AGENT_ID\": \"42\",\n      \"DSR_NAME\": \"your_dsr_graph_name\"\n    }\n  }\n}\n```\n\n#### Using pip installation\n\n```json\n{\n  \"dsr mcp server\": {\n    \"type\": \"stdio\",\n    \"command\": \"python3\",\n    \"args\": [\n      \"-m\",\n      \"dsr_mcp_server\"\n    ],\n    \"env\": {\n      \"DSR_AGENT_ID\": \"42\", \n      \"DSR_NAME\": \"your_dsr_graph_name\"\n    }\n  }\n}\n```\n\n#### HTTP Server Mode\n\nFor HTTP transport integration:\n\n```json\n{\n  \"servers\": {\n    \"dsr_mcp_server\": {\n      \"type\": \"http\",\n      \"url\": \"http://localhost:3000/mcp\"\n    }\n  }\n}\n```\n\n## Technical Notes\n\n* Connection to DSR is performed with automatic initialization and connection monitoring.\n* Node attributes are filtered to exclude internal rendering properties (color, depth, height, level, etc.) for cleaner output.\n* Edge relationships support various types including spatial (near), ownership (has), identity (is), and association (is_with) semantics.\n* Graph operations maintain consistency through the DSR library's built-in validation mechanisms.\n* All tools return standardized JSON responses with success/error status and detailed information.\n* Interactive file selection for graph export operations through MCP elicit mechanism.\n* **Resources** provide read-only, idempotent access to DSR graph data with efficient caching and lower overhead compared to tools. Use resources for querying data and tools for modifications.\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes following the coding conventions\n4. Add tests if applicable\n5. Submit a pull request\n\n## Support\n\nFor issues, questions, or contributions, please refer to the [project's issue tracker](https://github.com/grupo-avispa/dsr_mcp_server/issues) or contact the development team.\n",
  "bytes": 8904,
  "sha": "492a6d1c38d85eb8ef13ba260f6619b2ddda07e3a524ff94300b91ebe46efcda",
  "repo_slug": "grupo-avispa/dsr_mcp_server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_grupo_avispa_dsr_mcp_server_30482feb/readme"
}