Skip to content

Commit ddd2028

Browse files
authored
Merge pull request #46 from tishun/topic/tishun/pr-43
Fixing CI issues and adding tests for the list of tools
2 parents aab091e + d4fcb66 commit ddd2028

File tree

8 files changed

+435
-25
lines changed

8 files changed

+435
-25
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Redis MCP Server
2-
[![Integration](https://github.com/redis/mcp-redis/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/redis/lettuce/actions/workflows/integration.yml)
2+
[![Integration](https://github.com/redis/mcp-redis/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/redis/mcp-redis/actions/workflows/ci.yml)
33
[![Python Version](https://img.shields.io/badge/python-3.13%2B-blue)](https://www.python.org/downloads/)
44
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
55
[![smithery badge](https://smithery.ai/badge/@redis/mcp-redis)](https://smithery.ai/server/@redis/mcp-redis)
66
[![Verified on MseeP](https://mseep.ai/badge.svg)](https://mseep.ai/app/70102150-efe0-4705-9f7d-87980109a279)
7-
[![codecov](https://codecov.io/gh/redis/mcp-redis/branch/master/graph/badge.svg?token=yenl5fzxxr)](https://codecov.io/gh/redis/mcp-redis)
7+
![Docker Image Version](https://img.shields.io/docker/v/mcp/redis?sort=semver&logo=docker&label=Docker)
88

99

1010
[![Discord](https://img.shields.io/discord/697882427875393627.svg?style=social&logo=discord)](https://discord.gg/redis)

src/common/server.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
import pkgutil
33
from mcp.server.fastmcp import FastMCP
44

5+
56
def load_tools():
67
import src.tools as tools_pkg
8+
79
for _, module_name, _ in pkgutil.iter_modules(tools_pkg.__path__):
810
importlib.import_module(f"src.tools.{module_name}")
911

12+
1013
# Initialize FastMCP server
1114
mcp = FastMCP("Redis MCP Server", dependencies=["redis", "dotenv", "numpy"])
1215

src/tools/json.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import json
2-
from typing import Union, Mapping, List, TYPE_CHECKING, Any
2+
from typing import Union, Mapping, List, TYPE_CHECKING
33
from redis.exceptions import RedisError
44

55
from src.common.connection import RedisConnectionManager
66
from src.common.server import mcp
77

88
# Define JsonType for type checking to match redis-py definition
9+
# Use object as runtime type to avoid issubclass() issues with Any in Python 3.10
910
if TYPE_CHECKING:
1011
JsonType = Union[
1112
str, int, float, bool, None, Mapping[str, "JsonType"], List["JsonType"]
1213
]
1314
else:
14-
# Use Any at runtime to avoid Pydantic issues with recursive types
15-
JsonType = Any
15+
# Use object at runtime to avoid MCP framework issubclass() issues
16+
JsonType = object
1617

1718

1819
@mcp.tool()

src/tools/string.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010

1111
@mcp.tool()
12-
async def set(key: str, value: Union[str, bytes, int, float, dict], expiration: int = None) -> str:
12+
async def set(
13+
key: str, value: Union[str, bytes, int, float, dict], expiration: int = None
14+
) -> str:
1315
"""Set a Redis string value with an optional expiration time.
1416
1517
Args:

0 commit comments

Comments
 (0)