Skip to content

Commit a21b09c

Browse files
committed
Merge branch 'improve_typing'
2 parents dd8c5ca + 9dc7eb2 commit a21b09c

File tree

7 files changed

+12
-10
lines changed

7 files changed

+12
-10
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<div align="center">
44

5+
<img src="icon.png" alt="MCP Server Fuzzer Icon" width="100" height="100">
6+
57
**A comprehensive super-aggressive CLI-based fuzzing tool for MCP servers**
68

79
*Multi-protocol support • Two-phase fuzzing • Built-in safety • Rich reporting • async runtime and async fuzzing of mcp tools*

icon.png

74.5 KB
Loading

mcp_fuzzer/fuzz_engine/invariants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def check_response_schema_conformity(response: Any, schema: dict[str, Any]) -> b
216216
def verify_response_invariants(
217217
response: Any,
218218
expected_error_codes: list[int] | None = None,
219-
schema: dict[str, Any | None] = None,
219+
schema: dict[str, Any] | None = None,
220220
) -> bool:
221221
"""
222222
Verify all invariants for a response.
@@ -248,7 +248,7 @@ def verify_response_invariants(
248248
async def verify_batch_responses(
249249
responses: list[Any],
250250
expected_error_codes: list[int] | None = None,
251-
schema: dict[str, Any | None] = None,
251+
schema: dict[str, Any] | None = None,
252252
) -> dict[int, bool | str]:
253253
"""
254254
Verify invariants for a batch of responses asynchronously.

mcp_fuzzer/transport/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
class TransportProtocol(ABC):
1313
@abstractmethod
1414
async def send_request(
15-
self, method: str, params: dict[str, Any | None] = None
15+
self, method: str, params: dict[str, Any] | None = None
1616
) -> Any:
1717
pass
1818

@@ -22,7 +22,7 @@ async def send_raw(self, payload: dict[str, Any]) -> Any:
2222

2323
@abstractmethod
2424
async def send_notification(
25-
self, method: str, params: dict[str, Any | None] = None
25+
self, method: str, params: dict[str, Any] | None = None
2626
) -> None:
2727
pass
2828

mcp_fuzzer/transport/custom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def register(
2626
name: str,
2727
transport_class: Type[TransportProtocol],
2828
description: str = "",
29-
config_schema: dict[str, Any | None] = None,
29+
config_schema: dict[str, Any] | None = None,
3030
factory_function: Callable | None = None,
3131
) -> None:
3232
"""Register a custom transport.
@@ -155,7 +155,7 @@ def register_custom_transport(
155155
name: str,
156156
transport_class: Type[TransportProtocol],
157157
description: str = "",
158-
config_schema: dict[str, Any | None] = None,
158+
config_schema: dict[str, Any] | None = None,
159159
factory_function: Callable | None = None,
160160
) -> None:
161161
"""Register a custom transport with the global registry.

mcp_fuzzer/transport/mixins.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __init__(self, *args, **kwargs):
9898
def _create_jsonrpc_request(
9999
self,
100100
method: str,
101-
params: dict[str, Any | None] = None,
101+
params: dict[str, Any] | None = None,
102102
request_id: str | int | None = None,
103103
) -> JSONRPCRequest:
104104
"""Create a JSON-RPC request payload.
@@ -129,7 +129,7 @@ def _create_jsonrpc_request(
129129
return payload
130130

131131
def _create_jsonrpc_notification(
132-
self, method: str, params: dict[str, Any | None] = None
132+
self, method: str, params: dict[str, Any] | None = None
133133
) -> JSONRPCNotification:
134134
"""Create a JSON-RPC notification payload.
135135

mcp_fuzzer/transport/streamable_http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def _extract_content_type(self, response: httpx.Response) -> str:
157157
return response.headers.get(CONTENT_TYPE, "").lower()
158158

159159
async def send_request(
160-
self, method: str, params: dict[str, Any | None] = None
160+
self, method: str, params: dict[str, Any] | None = None
161161
) -> Any:
162162
request_id = str(asyncio.get_running_loop().time())
163163
payload = {
@@ -276,7 +276,7 @@ async def send_raw(self, payload: dict[str, Any]) -> Any:
276276
raise Exception(f"Unexpected content type: {ct}")
277277

278278
async def send_notification(
279-
self, method: str, params: dict[str, Any | None] = None
279+
self, method: str, params: dict[str, Any] | None = None
280280
) -> None:
281281
payload = {"jsonrpc": "2.0", "method": method, "params": params or {}}
282282
headers = self._prepare_headers()

0 commit comments

Comments
 (0)