Skip to content

Feat: Add MCP client caching configuration to Configuration Plans - #374

Merged
lbroudoux merged 5 commits into
reshaprio:mainfrom
Vaishnav88sk:feature/issue-323-caching-configuration
Sep 2, 2026
Merged

Feat: Add MCP client caching configuration to Configuration Plans#374
lbroudoux merged 5 commits into
reshaprio:mainfrom
Vaishnav88sk:feature/issue-323-caching-configuration

Conversation

@Vaishnav88sk

Copy link
Copy Markdown
Contributor

Closes #323

Description

This PR introduces support for customizing the MCP client-side caching configuration (ttlMs and cacheScope) per Configuration Plan, as requested in #323. Previously, caching hints for tools/list and tools/read were hardcoded to 30000ms and public.

With this change, administrators can explicitly define these settings in the UI or via the API, which the proxy will use during MCP interactions (protocol ≥ 2026-07-28).

Changes

  • Database: Added caching_configuration (JSONB) to the configuration_plan table (Flyway V1.5.0).
  • API / Control Plane: Added cachingConfiguration field to ConfigurationPlan, ConfigurationPlanDTO, and eds-v1.proto.
  • Proxy: Removed hardcoded values in McpController and wired it to read from the dynamically loaded ConfigurationEntry.
  • Web UI: Added "Cache TTL (ms)" and "Cache scope" inputs to the Operations section in PlanEditor.svelte.

Verification

Screenshot from 2026-08-25 14-26-08
vaishnavsk@vaishnav88:~$ curl -s -X POST http://localhost:7777/mcp/reshapr/dummy/1.0 \
  -H "Content-Type: application/json" \
  -H "MCP-Protocol-Version: 2026-07-28" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | python3 -m json.tool
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "resultType": "complete",
        "tools": [
            {
                "name": "get_hello",
                "inputSchema": {
                    "type": "object",
                    "properties": {},
                    "required": [],
                    "additionalProperties": false
                }
            }
        ],
        "ttlMs": 120000,
        "cacheScope": "private"
    }
}

@Vaishnav88sk
Vaishnav88sk force-pushed the feature/issue-323-caching-configuration branch 2 times, most recently from b301cd0 to 4a84ef9 Compare August 25, 2026 09:42
@Vaishnav88sk

Copy link
Copy Markdown
Contributor Author

/hold
Adding CLI rel code

@Vaishnav88sk

Vaishnav88sk commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

/unhold

Updated CLI code:

vaishnavsk@vaishnav88:~/reshapr/cli$ reshapr service list
ID             NAME           VERSION  TYPE  AGE
0RDKX7826076H  Dummy Service  1.0.0    REST  76s
vaishnavsk@vaishnav88:~/reshapr/cli$ reshapr config create my_plan -s 0RDKX7826076H --be http://localhost:8080 --ct 15000 --cs private
✅ Configuration plan 'my_plan' created successfully with ID: 0RDKXKPD207FX
vaishnavsk@vaishnav88:~/reshapr/cli$ reshapr config list
ID             NAME          SERVICE        BACKEND                API_KEY  OAUTH2_CONFIG  AUDIT
0RDKX78SE07BW  default       0RDKX7826076H  http://localhost:8080  No       No             No
0RDKX919Y07FG  my-test-plan  0RDKX7826076H  http://localhost:8080  No       No             No
0RDKXKPD207FX  my_plan       0RDKX7826076H  http://localhost:8080  No       No             No
vaishnavsk@vaishnav88:~/reshapr/cli$ reshapr config get 0RDKXKPD207FX -o json
{
  "id": "0RDKXKPD207FX",
  "organizationId": "acme",
  "name": "my_plan",
  "serviceId": "0RDKX7826076H",
  "backendEndpoint": "http://localhost:8080",
  "includedArtifacts": [],
  "audit": false,
  "cachingConfiguration": {
    "ttlMs": 15000,
    "cacheScope": "private"
  }
}
vaishnavsk@vaishnav88:~/reshapr/cli$ 

@lbroudoux lbroudoux added theme/mcp enhancement New feature or request labels Aug 31, 2026
@lbroudoux

Copy link
Copy Markdown
Member

This is really great! I have one doubt about the naming. ConfigurationPlan.cacheConfiguration is a bit long and redundant, IMO. I wonder if we could shorten this:

What do you think?

@lbroudoux lbroudoux added this to the 0.2.3 milestone Aug 31, 2026
@Vaishnav88sk

Copy link
Copy Markdown
Contributor Author

Thanks, Laurent! I totally agree that cachingConfiguration is a bit long and redundant.

I think cachePolicy is the best option here. It aligns perfectly with standard API gateway terminology since we are defining strict rules (like TTL and Scope) for this specific plan.

It also ties in perfectly with the discussion in #326! If we stick with Template for #326 (which acts as a blueprint to quickly initialize values), it makes total sense that a Template would populate the cachePolicy inside a ConfigurationPlan.

I'll go ahead and update the database, API payloads, CLI, and Web UI to use the new name!

@Vaishnav88sk
Vaishnav88sk force-pushed the feature/issue-323-caching-configuration branch 2 times, most recently from 2874561 to 2f58166 Compare September 2, 2026 06:57
Signed-off-by: Vaishnav88sk <vaishnavsk8804@gmail.com>
Signed-off-by: Vaishnav88sk <vaishnavsk8804@gmail.com>
Signed-off-by: Vaishnav88sk <vaishnavsk8804@gmail.com>
Resolves reviewer feedback to use cachePolicy terminology for better consistency with modern API Gateways and the upcoming Template architectures.

Signed-off-by: Vaishnav88sk <vaishnavsk8804@gmail.com>
Quarkus test executions read application.properties/version.properties directly from src/main/resources to support hot-reloading. This skips the Maven filtering phase for those files, leaving ${maven.build.timestamp} unresolved, which causes SmallRye Config to throw a NoSuchElementException and crashes the test startup.

Adding %test.maven.build.timestamp=test provides a dummy fallback specifically for the test profile.

Signed-off-by: Vaishnav88sk <vaishnavsk8804@gmail.com>
@Vaishnav88sk
Vaishnav88sk force-pushed the feature/issue-323-caching-configuration branch from 2f58166 to 9df9516 Compare September 2, 2026 07:12

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great! Thanks @Vaishnav88sk, for this big contribution!

@lbroudoux
lbroudoux merged commit 20d1643 into reshaprio:main Sep 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request theme/mcp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a caching configuration into Configuration Plan

2 participants