[PR #206] feat: Resource and resource templates support #205

Open
opened 2026-10-18 21:12:41 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/mcpo/pull/206
Author: @krewi1
Created: 7/17/2025
Status: 🔄 Open

Base: dev ← Head: main


📝 Commits (10+)

  • 1feed83 Introduce resource and resource templates support in mcp
  • d54032d Revert back the version
  • 21c37dd Do not convert from list back to single string because of how openwebui is rendering
  • 0dcda9e Remove redundant comments
  • 712c869 One more comment deletion
  • 6eef961 Merge remote-tracking branch 'upstream/dev'
  • 5bf2080 Process the response
  • 3dc7d24 Add check for corrent path in register_resource_templates test and fix other tests after refactoring
  • 63fb4bc Merge remote-tracking branch 'upstream/dev'
  • ad15827 Fix errors after incorrect merge

📊 Changes

13 files changed (+923 additions, -441 deletions)

View changed files

📝 pyproject.toml (+2 -1)
📝 src/mcpo/main.py (+15 -51)
➕ src/mcpo/tests/test_register_resource_templates.py (+135 -0)
➕ src/mcpo/tests/test_register_resources.py (+96 -0)
📝 src/mcpo/tests/test_register_tools.py (+1 -1)
➕ src/mcpo/tests/test_resource_response.py (+87 -0)
➕ src/mcpo/utils/normalize_server_type.py (+5 -0)
➕ src/mcpo/utils/register_resource_templates.py (+49 -0)
➕ src/mcpo/utils/register_resources.py (+33 -0)
📝 src/mcpo/utils/register_tools.py (+43 -6)
➕ src/mcpo/utils/resource_response.py (+26 -0)
➕ src/mcpo/utils/routes.py (+9 -0)
📝 uv.lock (+422 -382)

📄 Description

Pull Request Checklist

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests to validate the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

  • 📚 MCP Resources and Resource Templates Support: Added comprehensive support for MCP resources and resource templates, enabling direct access to static and parameterized resources through automatically generated endpoints—making it easier to expose and consume content like documents, images, and structured data through the MCP protocol.

Description

This PR adds comprehensive support for MCP resources and resource templates, enabling:

  • Direct access to static and parameterized resources through automatically generated endpoints
  • Easier exposure and consumption of content like documents, images, and structured data through the MCP protocol

These changes enhance the functionality of the MCP protocol by providing a standardized way to handle various resource types.

Added

  • MCP Resources support for static content delivery
  • Resource Templates functionality for parameterized resources
  • Automatic endpoint generation for registered resources

Changed

  • Enhanced routing system to accommodate resource endpoints
  • Improved documentation to include resource usage examples

Deprecated

  • None

Removed

  • None

Fixed

  • None

Security

  • Added proper content type validation for uploaded resources

Breaking Changes

  • None

Additional Information

  • This PR overrides PR #155
  • This PR implements issue #134

Screenshots or Videos

Screenshot 2025-07-17 at 13 15 29

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/mcpo/pull/206 **Author:** [@krewi1](https://github.com/krewi1) **Created:** 7/17/2025 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `main` --- ### 📝 Commits (10+) - [`1feed83`](https://github.com/open-webui/mcpo/commit/1feed839f3dd3d1710a058fb7c1514557d9fcd6a) Introduce resource and resource templates support in mcp - [`d54032d`](https://github.com/open-webui/mcpo/commit/d54032de6a21ebf10900bf125f88a4ecc16fea75) Revert back the version - [`21c37dd`](https://github.com/open-webui/mcpo/commit/21c37dd6fdc1706c0a3f840f4679bee70782fc62) Do not convert from list back to single string because of how openwebui is rendering - [`0dcda9e`](https://github.com/open-webui/mcpo/commit/0dcda9ef948e92ffdae25094a710212714b9626a) Remove redundant comments - [`712c869`](https://github.com/open-webui/mcpo/commit/712c869900bfd422d9a589249a11322db24609f8) One more comment deletion - [`6eef961`](https://github.com/open-webui/mcpo/commit/6eef961b9a8650d875cacb006800d37a012dd695) Merge remote-tracking branch 'upstream/dev' - [`5bf2080`](https://github.com/open-webui/mcpo/commit/5bf208002cb245b99f459ff0d5e70f5b3e55e5e4) Process the response - [`3dc7d24`](https://github.com/open-webui/mcpo/commit/3dc7d24dfb7ef1478b5967e553cfe2215bbb1658) Add check for corrent path in register_resource_templates test and fix other tests after refactoring - [`63fb4bc`](https://github.com/open-webui/mcpo/commit/63fb4bc7c1dc7f579fbd75e9b4b978cdc50393ad) Merge remote-tracking branch 'upstream/dev' - [`ad15827`](https://github.com/open-webui/mcpo/commit/ad158270707567ea3bec8bfae8b056fb405fa3cf) Fix errors after incorrect merge ### 📊 Changes **13 files changed** (+923 additions, -441 deletions) <details> <summary>View changed files</summary> 📝 `pyproject.toml` (+2 -1) 📝 `src/mcpo/main.py` (+15 -51) ➕ `src/mcpo/tests/test_register_resource_templates.py` (+135 -0) ➕ `src/mcpo/tests/test_register_resources.py` (+96 -0) 📝 `src/mcpo/tests/test_register_tools.py` (+1 -1) ➕ `src/mcpo/tests/test_resource_response.py` (+87 -0) ➕ `src/mcpo/utils/normalize_server_type.py` (+5 -0) ➕ `src/mcpo/utils/register_resource_templates.py` (+49 -0) ➕ `src/mcpo/utils/register_resources.py` (+33 -0) 📝 `src/mcpo/utils/register_tools.py` (+43 -6) ➕ `src/mcpo/utils/resource_response.py` (+26 -0) ➕ `src/mcpo/utils/routes.py` (+9 -0) 📝 `uv.lock` (+422 -382) </details> ### 📄 Description # Pull Request Checklist **Before submitting, make sure you've checked the following:** - [x] **Target branch:** Please verify that the pull request targets the `dev` branch. - [x] **Description:** Provide a concise description of the changes made in this pull request. - [x] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Have you written and run sufficient tests to validate the changes? - [x] **Code review:** Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards? - [x] **Prefix:** To clearly categorize this pull request, prefix the pull request title using one of the following: - **BREAKING CHANGE**: Significant changes that may affect compatibility - **build**: Changes that affect the build system or external dependencies - **ci**: Changes to our continuous integration processes or workflows - **chore**: Refactor, cleanup, or other non-functional code changes - **docs**: Documentation update or addition - **feat**: Introduces a new feature or enhancement to the codebase - **fix**: Bug fix or error correction - **i18n**: Internationalization or localization changes - **perf**: Performance improvement - **refactor**: Code restructuring for better maintainability, readability, or scalability - **style**: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.) - **test**: Adding missing tests or correcting existing tests - **WIP**: Work in progress, a temporary label for incomplete or ongoing work # Changelog Entry - 📚 **MCP Resources and Resource Templates Support**: Added comprehensive support for MCP resources and resource templates, enabling direct access to static and parameterized resources through automatically generated endpoints—making it easier to expose and consume content like documents, images, and structured data through the MCP protocol. ### Description This PR adds comprehensive support for MCP resources and resource templates, enabling: - Direct access to static and parameterized resources through automatically generated endpoints - Easier exposure and consumption of content like documents, images, and structured data through the MCP protocol These changes enhance the functionality of the MCP protocol by providing a standardized way to handle various resource types. ### Added - MCP Resources support for static content delivery - Resource Templates functionality for parameterized resources - Automatic endpoint generation for registered resources ### Changed - Enhanced routing system to accommodate resource endpoints - Improved documentation to include resource usage examples ### Deprecated - None ### Removed - None ### Fixed - None ### Security - Added proper content type validation for uploaded resources ### Breaking Changes - None --- ### Additional Information - This PR overrides PR [#155](https://github.com/open-webui/mcpo/pull/155) - This PR implements issue [#134](https://github.com/open-webui/mcpo/issues/134) ### Screenshots or Videos <img width="920" height="556" alt="Screenshot 2025-07-17 at 13 15 29" src="https://github.com/user-attachments/assets/d66ee912-197d-4453-944a-85fda7cf1f3c" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/mcpo#205
No description provided.