Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion agentic_security/mcp/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import asyncio
from typing import Any

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
Expand All @@ -13,7 +14,7 @@
)


async def run() -> None:
async def run() -> tuple[Any, Any, Any] | None:
try:
logger.info(
"Starting stdio client session with server parameters: %s", server_params
Expand Down
14 changes: 8 additions & 6 deletions agentic_security/mcp/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Any

import httpx
from mcp.server.fastmcp import FastMCP

Expand All @@ -12,7 +14,7 @@


@mcp.tool()
async def verify_llm(spec: str) -> dict:
async def verify_llm(spec: str) -> dict[str, Any]:
"""
Verify an LLM model specification using the FastAPI server

Expand All @@ -34,7 +36,7 @@ async def start_scan(
maxBudget: int,
optimize: bool = False,
enableMultiStepAttack: bool = False,
) -> dict:
) -> dict[str, Any]:
"""
Start an LLM security scan via the FastAPI server.
Returns:
Expand All @@ -48,7 +50,7 @@ async def start_scan(

"""
url = f"{AGENTIC_SECURITY}/scan"
payload = {
payload: dict[str, Any] = {
"llmSpec": llmSpec,
"maxBudget": maxBudget,
"datasets": [],
Expand All @@ -63,7 +65,7 @@ async def start_scan(


@mcp.tool()
async def stop_scan() -> dict:
async def stop_scan() -> dict[str, Any]:
"""Stop an ongoing scan via the FastAPI server.

Returns:
Expand All @@ -76,7 +78,7 @@ async def stop_scan() -> dict:


@mcp.tool()
async def get_data_config() -> list:
async def get_data_config() -> list[dict[str, Any]]:
"""
Retrieve data configuration from the FastAPI server.

Expand All @@ -90,7 +92,7 @@ async def get_data_config() -> list:


@mcp.tool()
async def get_spec_templates() -> list:
async def get_spec_templates() -> list[dict[str, Any]]:
"""
Retrieve data configuration from the FastAPI server.

Expand Down
Loading