From 563ec51b03e922787997d7cbe0db3c2e569b5dac Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Mon, 13 Apr 2026 23:57:40 -0400 Subject: [PATCH] chore(mcp): remove unused imports in trustgraph-mcp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #784. ruff F401 pass on `trustgraph-mcp/trustgraph/mcp_server/`: - `tg_socket.py` — drop `dataclasses.dataclass` and `time` (the example called out in the issue; neither is referenced anywhere in the file). - `mcp.py` — drop five additional unused imports surfaced by ruff in the same directory: `typing.Optional`, `time`, `typing.AsyncGenerator`, `asyncio`, `uuid`, `mcp.types.TextContent`, and `websockets.asyncio.client.connect`. Scope is limited to the mcp_server directory — seven F401 hits, all autofixable. Other packages in the monorepo have more F401 warnings that can be cleaned up in follow-up PRs to keep this one reviewable. `ruff check --select F401 trustgraph-mcp/trustgraph/mcp_server/` is clean after the change. --- trustgraph-mcp/trustgraph/mcp_server/mcp.py | 8 +------- trustgraph-mcp/trustgraph/mcp_server/tg_socket.py | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/trustgraph-mcp/trustgraph/mcp_server/mcp.py b/trustgraph-mcp/trustgraph/mcp_server/mcp.py index eadd841b..b970c03c 100755 --- a/trustgraph-mcp/trustgraph/mcp_server/mcp.py +++ b/trustgraph-mcp/trustgraph/mcp_server/mcp.py @@ -1,20 +1,14 @@ from contextlib import asynccontextmanager -from typing import Optional import os -import time -from typing import AsyncGenerator, Any, Dict, List -import asyncio +from typing import Any, Dict, List import logging import json -import uuid import argparse from dataclasses import dataclass from collections.abc import AsyncIterator from functools import partial from mcp.server.fastmcp import FastMCP, Context -from mcp.types import TextContent -from websockets.asyncio.client import connect from trustgraph.base.logging import add_logging_args, setup_logging diff --git a/trustgraph-mcp/trustgraph/mcp_server/tg_socket.py b/trustgraph-mcp/trustgraph/mcp_server/tg_socket.py index d255ae14..ddde2bf0 100644 --- a/trustgraph-mcp/trustgraph/mcp_server/tg_socket.py +++ b/trustgraph-mcp/trustgraph/mcp_server/tg_socket.py @@ -1,12 +1,10 @@ -from dataclasses import dataclass from websockets.asyncio.client import connect from urllib.parse import urlencode, urlparse, urlunparse, parse_qs import asyncio import logging import json import uuid -import time class WebSocketManager: