Skip to content

Commit 6b57983

Browse files
authored
Merge pull request #1484 from Jay-IRL/toolops_main
Toolops features in MCP context forge
2 parents 142e453 + 3f814e9 commit 6b57983

36 files changed

+3935
-318
lines changed

.env.example

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,15 @@ REQUIRE_STRONG_SECRETS=false
10001000
# NOT RECOMMENDED for production!
10011001
# REQUIRE_STRONG_SECRETS=false
10021002

1003+
#####################################
1004+
# ToolOps Configuration
1005+
#####################################
1006+
1007+
# Enable the ToolOps functionality (true/false)
1008+
# When disabled, ToolOps features will be completely hidden from UI and APIs
1009+
# Default: false (must be explicitly enabled)
1010+
TOOLOPS_ENABLED=false
1011+
10031012
#####################################
10041013
# LLM Chat MCP Client Configuration
10051014
#####################################
@@ -1012,7 +1021,7 @@ LLMCHAT_ENABLED=false
10121021
# LLM Provider Selection
10131022
# Options: azure_openai, openai, anthropic, aws_bedrock, ollama
10141023
# Default: azure_openai
1015-
# LLM_PROVIDER=azure_openai
1024+
LLM_PROVIDER=openai
10161025

10171026
# Redis Configuration for chat session storage and maintaining history
10181027
# CACHE_TYPE should be set to "redis" and REDIS_URL configured appropriately as mentioned in the caching section.
@@ -1040,11 +1049,12 @@ LLMCHAT_CHAT_HISTORY_MAX_MESSAGES=50 # Maximum message history to store p
10401049
# OpenAI Configuration
10411050
#####################################
10421051
# Use for direct OpenAI API access (non-Azure) or OpenAI-compatible endpoints
1043-
# OPENAI_API_KEY=sk-...
1044-
# OPENAI_MODEL=gpt-4o-mini
1045-
# OPENAI_BASE_URL=https://api.openai.com/v1 # Optional: for OpenAI-compatible endpoints
1046-
# OPENAI_TEMPERATURE=0.7
1052+
# OPENAI_API_KEY=
1053+
# OPENAI_MODEL=meta-llama/llama-3-3-70b-instruct
1054+
# OPENAI_BASE_URL= # Optional: for OpenAI-compatible endpoints
1055+
# OPENAI_TEMPERATURE=0.1
10471056
# OPENAI_MAX_RETRIES=2
1057+
# OPENAI_MAX_TOEKNS=1000
10481058

10491059
#####################################
10501060
# Anthropic Claude Configuration

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ recursive-include tests/async *.py
3131
recursive-include tests/async *.yaml
3232
recursive-include examples *.yaml
3333
recursive-include plugin_templates *
34+
recursive-include mcpgateway/toolops *.md
3435

3536
# Tooling/lint configuration dot-files (explicit so they're not lost)
3637
include .env.make

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,14 @@ You can get started by copying the provided [.env.example](https://github.com/IB
12931293
- `MCPGATEWAY_A2A_ENABLED=false`: Completely disables A2A features (API endpoints return 404, admin tab hidden)
12941294
- `MCPGATEWAY_A2A_METRICS_ENABLED=false`: Disables metrics collection while keeping functionality
12951295

1296+
### ToolOps
1297+
1298+
ToolOps streamlines the entire workflow by enabling seamless tool enrichment, automated test case generation, and comprehensive tool validation.
1299+
1300+
| Setting | Description | Default | Options |
1301+
| ------------------------------ | -------------------------------------- | ------- | ------- |
1302+
| `TOOLOPS_ENABLED` | Enable ToolOps functionality | `false` | bool |
1303+
12961304
### LLM Chat MCP Client
12971305

12981306
The LLM Chat MCP Client allows you to interact with MCP servers using conversational AI from multiple LLM providers. This feature enables natural language interaction with tools, resources, and prompts exposed by MCP servers.
@@ -1364,11 +1372,16 @@ The LLM Chat MCP Client allows you to interact with MCP servers using conversati
13641372
| `OLLAMA_MODEL` | Ollama model name | `llama3.2` | string |
13651373
| `OLLAMA_TEMPERATURE` | Sampling temperature | `0.7` | float (0.0-2.0) |
13661374

1375+
> ⚙️ **ToolOps**: To manage the complete tool workflow — enrich tools, generate test cases automatically, and validate them with ease.
13671376
> 🤖 **LLM Chat Integration**: Chat with MCP servers using natural language powered by Azure OpenAI, OpenAI, Anthropic Claude, AWS Bedrock, or Ollama
13681377
> 🔧 **Flexible Providers**: Switch between different LLM providers without changing your MCP integration
13691378
> 🔒 **Security**: API keys and credentials are securely stored and never exposed in responses
13701379
> 🎛️ **Admin UI**: Dedicated LLM Chat tab in the admin interface for interactive conversations
13711380

1381+
**ToolOps Configuration Effects:**
1382+
- `TOOLOPS_ENABLED=false` (default): Completely disables ToolOps features (API endpoints return 404, admin tab hidden)
1383+
- `TOOLOPS_ENABLED=true`: Enables ToolOps functionality in the UI
1384+
13721385
**LLM Chat Configuration Effects:**
13731386
- `LLMCHAT_ENABLED=false` (default): Completely disables LLM Chat features (API endpoints return 404, admin tab hidden)
13741387
- `LLMCHAT_ENABLED=true`: Enables LLM Chat functionality with the selected provider

charts/mcp-stack/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ mcpContextForge:
189189
# ─ UI Configuration ─
190190
MCPGATEWAY_UI_TOOL_TEST_TIMEOUT: "60000" # tool test timeout in milliseconds for the admin UI
191191

192+
# ─ ToolOps Feature ─
193+
TOOLOPS_ENABLED: "false" # enable ToolOps feature
194+
192195
# ─ LLM Chat Feature ─
193196
LLMCHAT_ENABLED: "false" # enable LLM Chat feature
194197

docs/config.schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,12 @@
10211021
"title": "Llmchat Enabled",
10221022
"type": "boolean"
10231023
},
1024+
"toolops_enabled": {
1025+
"default": false,
1026+
"description": "Enable ToolOps feature",
1027+
"title": "ToolOps Enabled",
1028+
"type": "boolean"
1029+
},
10241030
"retry_max_attempts": {
10251031
"default": 3,
10261032
"title": "Retry Max Attempts",

docs/docs/config.schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,12 @@
10211021
"title": "Llmchat Enabled",
10221022
"type": "boolean"
10231023
},
1024+
"toolops_enabled": {
1025+
"default": false,
1026+
"description": "Enable ToolOps feature",
1027+
"title": "ToolOps Enabled",
1028+
"type": "boolean"
1029+
},
10241030
"retry_max_attempts": {
10251031
"default": 3,
10261032
"title": "Retry Max Attempts",

mcpgateway/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,6 +2668,7 @@ def _to_dict_and_filter(raw_list):
26682668
"grpc_enabled": GRPC_AVAILABLE and settings.mcpgateway_grpc_enabled,
26692669
"catalog_enabled": settings.mcpgateway_catalog_enabled,
26702670
"llmchat_enabled": getattr(settings, "llmchat_enabled", False),
2671+
"toolops_enabled": getattr(settings, "toolops_enabled", False),
26712672
"observability_enabled": getattr(settings, "observability_enabled", False),
26722673
"current_user": get_user_email(user),
26732674
"email_auth_enabled": getattr(settings, "email_auth_enabled", False),
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# -*- coding: utf-8 -*-
2+
"""Location: ./mcpgateway/alembic/versions/add_toolops_test_case_table.py
3+
Copyright 2025
4+
SPDX-License-Identifier: Apache-2.0
5+
Authors: Jay Bandlamudi
6+
7+
add_a2a_agents_and_metrics
8+
9+
Revision ID: add_a2a_agents_and_metrics
10+
Revises: add_oauth_tokens_table
11+
Create Date: 2025-11-27 10:00:00.000000
12+
"""
13+
14+
# Standard
15+
from typing import Sequence, Union
16+
17+
# Third-Party
18+
from alembic import op
19+
import sqlalchemy as sa
20+
21+
# revision identifiers, used by Alembic.
22+
revision: str = "add_toolops_test_cases_table"
23+
down_revision: Union[str, Sequence[str], None] = "z1a2b3c4d5e6"
24+
branch_labels: Union[str, Sequence[str], None] = None
25+
depends_on: Union[str, Sequence[str], None] = None
26+
27+
28+
def upgrade() -> None:
29+
"""Add toolops test cases table"""
30+
31+
# Check if table already exists (for development scenarios)
32+
conn = op.get_bind()
33+
inspector = sa.inspect(conn)
34+
existing_tables = inspector.get_table_names()
35+
36+
if "toolops_test_cases" not in existing_tables:
37+
# Create a2a_agents table with unique constraints included (SQLite compatible)
38+
op.create_table(
39+
"toolops_test_cases",
40+
sa.Column("tool_id", sa.String(255), primary_key=True),
41+
sa.Column("test_cases", sa.JSON(), nullable=True),
42+
sa.Column("run_status", sa.String(255), nullable=True),
43+
)
44+
45+
46+
def downgrade() -> None:
47+
"""Reverse the toolops test cases tables."""
48+
# Check if tables exist before trying to drop indexes/tables
49+
conn = op.get_bind()
50+
inspector = sa.inspect(conn)
51+
existing_tables = inspector.get_table_names()
52+
53+
# Drop tables (if they exist)
54+
for table_name in ["toolops_test_cases"]:
55+
if table_name in existing_tables:
56+
try:
57+
op.drop_table(table_name)
58+
except Exception as e:
59+
print(f"Warning: Could not drop table {table_name}: {e}")

mcpgateway/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ class Settings(BaseSettings):
403403
require_strong_secrets: bool = False # Default to False for backward compatibility, will be enforced in 1.0.0
404404

405405
llmchat_enabled: bool = Field(default=False, description="Enable LLM Chat feature")
406+
toolops_enabled: bool = Field(default=False, description="Enable ToolOps feature")
406407

407408
# redis configurations for Maintaining Chat Sessions in multi-worker environment
408409
llmchat_session_ttl: int = Field(default=300, description="Seconds for active_session key TTL")

mcpgateway/db.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,6 +2431,24 @@ class ResourceSubscription(Base):
24312431
resource: Mapped["Resource"] = relationship(back_populates="subscriptions")
24322432

24332433

2434+
class ToolOpsTestCases(Base):
2435+
"""
2436+
ORM model for a registered Tool test cases.
2437+
2438+
Represents a tool and the generated test cases.
2439+
Includes:
2440+
- tool_id: unique tool identifier
2441+
- test_cases: generated test cases.
2442+
- run_status: status of test case generation
2443+
"""
2444+
2445+
__tablename__ = "toolops_test_cases"
2446+
2447+
tool_id: Mapped[str] = mapped_column(String(255), primary_key=True)
2448+
test_cases: Mapped[Dict[str, Any]] = mapped_column(JSON)
2449+
run_status: Mapped[str] = mapped_column(String(255), nullable=False)
2450+
2451+
24342452
class Prompt(Base):
24352453
"""
24362454
ORM model for a registered Prompt template.

0 commit comments

Comments
 (0)