Skip to content

Lock the MCP SDK dependency to version 1.11.0 #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 23, 2025

Conversation

akolotov
Copy link
Collaborator

@akolotov akolotov commented Jul 23, 2025

The functionality of HTTP Streamable server is broken in the versions 1.12.0 and 1.12.1:

INFO:     127.0.0.1:32926 - "POST /mcp/ HTTP/1.1" 307 Temporary Redirect
[07/23/25 16:34:18] INFO     Processing request of type ListToolsRequest                                        server.py:625
INFO:     127.0.0.1:32926 - "POST /mcp HTTP/1.1" 200 OK
                    INFO     Terminating session: None                                                 streamable_http.py:630
                    ERROR    Error in message router                                                   streamable_http.py:880
                             ╭────────────────── Traceback (most recent call last) ──────────────────╮                       
                             │ /usr/local/lib/python3.12/site-packages/mcp/server/streamable_http.py │                       
                             │ :831 in message_router                                                │                       
                             │                                                                       │                       
                             │   828 │   │   │   # Create a message router that distributes messages │                       
                             │   829 │   │   │   async def message_router():                         │                       
                             │   830 │   │   │   │   try:                                            │                       
                             │ ❱ 831 │   │   │   │   │   async for session_message in write_stream_r │                       
                             │   832 │   │   │   │   │   │   # Determine which request stream(s) sho │                       
                             │   833 │   │   │   │   │   │   message = session_message.message       │                       
                             │   834 │   │   │   │   │   │   target_request_id = None                │                       
                             │                                                                       │                       
                             │ /usr/local/lib/python3.12/site-packages/anyio/abc/_streams.py:35 in   │                       
                             │ __anext__                                                             │                       
                             │                                                                       │                       
                             │    32 │                                                               │                       
                             │    33 │   async def __anext__(self) -> T_co:                          │                       
                             │    34 │   │   try:                                                    │                       
                             │ ❱  35 │   │   │   return await self.receive()                         │                       
                             │    36 │   │   except EndOfStream:                                     │                       
                             │    37 │   │   │   raise StopAsyncIteration                            │                       
                             │    38                                                                 │                       
                             │                                                                       │                       
                             │ /usr/local/lib/python3.12/site-packages/anyio/streams/memory.py:111   │                       
                             │ in receive                                                            │                       
                             │                                                                       │                       
                             │   108 │   async def receive(self) -> T_co:                            │                       
                             │   109 │   │   await checkpoint()                                      │                       
                             │   110 │   │   try:                                                    │                       
                             │ ❱ 111 │   │   │   return self.receive_nowait()                        │                       
                             │   112 │   │   except WouldBlock:                                      │                       
                             │   113 │   │   │   # Add ourselves in the queue                        │                       
                             │   114 │   │   │   receive_event = Event()                             │                       
                             │                                                                       │                       
                             │ /usr/local/lib/python3.12/site-packages/anyio/streams/memory.py:93 in │                       
                             │ receive_nowait                                                        │                       
                             │                                                                       │                       
                             │    90 │   │                                                           │                       
                             │    91 │   │   """                                                     │                       
                             │    92 │   │   if self._closed:                                        │                       
                             │ ❱  93 │   │   │   raise ClosedResourceError                           │                       
                             │    94 │   │                                                           │                       
                             │    95 │   │   if self._state.waiting_senders:                         │                       
                             │    96 │   │   │   # Get the item from the next sender                 │                       
                             ╰───────────────────────────────────────────────────────────────────────╯                       
                             ClosedResourceError                                                                             

Summary by CodeRabbit

  • Chores
    • Updated the application version to 0.6.1.
    • Pinned a dependency to a specific version to ensure compatibility and stability.

@akolotov akolotov self-assigned this Jul 23, 2025
@akolotov akolotov requested a review from Copilot July 23, 2025 16:42
Copy link

coderabbitai bot commented Jul 23, 2025

Walkthrough

The version of the blockscout_mcp_server package was incremented from 0.6.0 to 0.6.1 in both the code and project configuration. Additionally, the dependency on the "mcp" package was updated from a minimum version requirement to a strict version pin at 1.11.0, with a comment noting compatibility issues with versions 1.12.0 and above.

Changes

File(s) Change Summary
blockscout_mcp_server/init.py Updated __version__ from "0.6.0" to "0.6.1".
pyproject.toml Bumped project version to 0.6.1 and changed "mcp[cli]" dependency from ">=1.10.1" to "==1.11.0".

Estimated code review effort

1 (~2 minutes)

Possibly related PRs

  • Bump server version to 0.6.0 #172: Both PRs exclusively update the version string in blockscout_mcp_server/__init__.py and the project version in pyproject.toml without altering any other functionality or code.
  • Bump the server version to 0.4.1 #132: Both PRs update the version string in blockscout_mcp_server/__init__.py and the project version in pyproject.toml without other code changes, making their changes directly related.
  • Bump MCP server to v0.5.0 #149: Both PRs update the version string in blockscout_mcp_server/__init__.py and the project version in pyproject.toml without other functional changes, making their changes directly related as version bumps.

Suggested labels

codex


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1e0b5b3 and 1a0ec6a.

📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • pyproject.toml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Docker build and docker push

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR locks the MCP SDK dependency to version 1.11.0 to resolve a critical bug in the HTTP Streamable server functionality that was introduced in versions 1.12.0 and 1.12.1. The issue causes a ClosedResourceError that breaks the server's message routing capability.

  • Lock MCP SDK dependency to version 1.11.0 instead of allowing >=1.10.1
  • Bump package version from 0.6.0 to 0.6.1 to reflect the dependency change

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pyproject.toml Updates dependency constraint and version bump
blockscout_mcp_server/init.py Updates package version constant

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
pyproject.toml (1)

7-7: Fix misleading inline comment when pinning the SDK

The comment still says “Or the latest version of the SDK”, which contradicts the deliberate hard-pin to 1.11.0. Clarify the rationale so future maintainers don’t loosen the pin accidentally.

-    "mcp[cli]==1.11.0",  # Or the latest version of the SDK
+    # Pinned to 1.11.0 – newer (≥1.12.0) versions break HTTP Streamable mode (see PR #174)
+    "mcp[cli]==1.11.0",
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 29ef92d and 1e0b5b3.

📒 Files selected for processing (2)
  • blockscout_mcp_server/__init__.py (1 hunks)
  • pyproject.toml (1 hunks)
📓 Path-based instructions (3)
pyproject.toml

📄 CodeRabbit Inference Engine (.cursor/rules/010-implementation-rules.mdc)

If any new package needs to be installed it needs to be done with 'sudo which uv pip install --system ""' command. Don't forget to update pyproject.toml with the new package.

When updating the version of the MCP server, update the version field in the [project] section of pyproject.toml.

Files:

  • pyproject.toml
**/*.py

📄 CodeRabbit Inference Engine (.cursor/rules/000-role-and-task.mdc)

**/*.py: The MCP server must be implemented in Python, as you are a senior Python developer and the expertise is in Python.
The MCP server must wrap Blockscout APIs and expose blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol (MCP).
The MCP server must communicate with AI agents/chat applications through stdin.

**/*.py: Regular Python modules should generally not exceed 500 lines of code (LOC). If a module approaches this limit, consider splitting it into multiple focused modules (e.g., address_tools.py and address_tools_advanced.py) to maintain readability and logical organization.
ALL import statements must be placed at the top of the Python module, immediately after the module docstring (if present) and before any other code. Never insert imports inline near where the functionality is used. Follow PEP 8 import order.
ALL linting and formatting issues must be resolved before committing or pushing code. Use the Ruff rules defined in 300-ruff-lint-and-format.mdc to identify and fix issues.

**/*.py: Always run ruff check . --fix and ruff format . on generated code before suggesting commits or opening a PR
Avoid using # noqa: E501 for ordinary code lines; split long lines instead. Only use # noqa: E501 for docstrings or string literals that must exceed 120 characters.
Use Ruff to enforce a 120-character line length, compatible with Black formatting

Files:

  • blockscout_mcp_server/__init__.py
blockscout_mcp_server/__init__.py

📄 CodeRabbit Inference Engine (.cursor/rules/130-version-management.mdc)

When updating the version of the MCP server, update the __version__ variable in blockscout_mcp_server/__init__.py.

Files:

  • blockscout_mcp_server/__init__.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to blockscout_mcp_server/__init__.py : When updating the version of the MCP server, update the `__version__` variable in `blockscout_mcp_server/__init__.py`.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.532Z
Learning: Applies to **/*.py : The MCP server must wrap Blockscout APIs and expose blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol (MCP).
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Use the exact same version string in both `pyproject.toml` and `blockscout_mcp_server/__init__.py`.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-22T00:11:00.226Z
Learning: Read the project technical description in `SPEC.md` to clearly understand how the MCP server communicates with counterparties and important aspects of the server implementation before responding to a user request.
Learnt from: akolotov
PR: blockscout/mcp-server#148
File: blockscout_mcp_server/api/routes.py:44-52
Timestamp: 2025-07-11T00:58:37.475Z
Learning: Logging is not currently used in the blockscout/mcp-server codebase. Full logging support will be implemented in a separate issue. Print statements are acceptable temporarily until proper logging is implemented.
Learnt from: akolotov
PR: blockscout/mcp-server#142
File: blockscout_mcp_server/api/routes.py:242-258
Timestamp: 2025-07-10T19:21:50.271Z
Learning: The user akolotov prefers a unified tool registration approach where a single function registers tools in both MCP and REST API instead of having separate registration points in blockscout_mcp_server/server.py and blockscout_mcp_server/api/routes.py. This would eliminate duplication and reduce maintenance burden.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Update both `pyproject.toml` and `blockscout_mcp_server/__init__.py` simultaneously to maintain consistency across the codebase.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to pyproject.toml : When updating the version of the MCP server, update the `version` field in the `[project]` section of `pyproject.toml`.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/200-development-testing-workflow.mdc:0-0
Timestamp: 2025-07-22T00:13:24.809Z
Learning: Ensure your changes are well-tested by checking test coverage using pytest --cov=blockscout_mcp_server --cov-report=term-missing
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/config.py : For paginated tools, add a dedicated page size configuration variable to blockscout_mcp_server/config.py.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/tools/*.py : Do not expose individual pagination parameters (like page, offset, items_count) in tool signatures; use a single opaque cursor string.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/config.py : Add new API endpoint configuration to blockscout_mcp_server/config.py when introducing a new external API endpoint.
pyproject.toml (10)

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to pyproject.toml : When updating the version of the MCP server, update the version field in the [project] section of pyproject.toml.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Update both pyproject.toml and blockscout_mcp_server/__init__.py simultaneously to maintain consistency across the codebase.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Use the exact same version string in both pyproject.toml and blockscout_mcp_server/__init__.py.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to blockscout_mcp_server/init.py : When updating the version of the MCP server, update the __version__ variable in blockscout_mcp_server/__init__.py.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.532Z
Learning: Applies to **/*.py : The MCP server must wrap Blockscout APIs and expose blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol (MCP).

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/200-development-testing-workflow.mdc:0-0
Timestamp: 2025-07-22T00:13:24.809Z
Learning: Ensure your changes are well-tested by checking test coverage using pytest --cov=blockscout_mcp_server --cov-report=term-missing

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/config.py : Add new API endpoint configuration to blockscout_mcp_server/config.py when introducing a new external API endpoint.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.532Z
Learning: Applies to **/*.py : The MCP server must be implemented in Python, as you are a senior Python developer and the expertise is in Python.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/server.py : Register each new tool in blockscout_mcp_server/server.py by importing the tool function and registering it with the MCP server using the @mcp.tool() decorator.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.532Z
Learning: Applies to {Dockerfile,docker-compose.yml} : The MCP server must be able to run locally or through Docker.

blockscout_mcp_server/__init__.py (12)

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to blockscout_mcp_server/init.py : When updating the version of the MCP server, update the __version__ variable in blockscout_mcp_server/__init__.py.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Use the exact same version string in both pyproject.toml and blockscout_mcp_server/__init__.py.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Update both pyproject.toml and blockscout_mcp_server/__init__.py simultaneously to maintain consistency across the codebase.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to pyproject.toml : When updating the version of the MCP server, update the version field in the [project] section of pyproject.toml.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/200-development-testing-workflow.mdc:0-0
Timestamp: 2025-07-22T00:13:24.809Z
Learning: Ensure your changes are well-tested by checking test coverage using pytest --cov=blockscout_mcp_server --cov-report=term-missing

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.532Z
Learning: Applies to **/*.py : The MCP server must wrap Blockscout APIs and expose blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol (MCP).

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/tools/*.py : Do not expose individual pagination parameters (like page, offset, items_count) in tool signatures; use a single opaque cursor string.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/config.py : Add new API endpoint configuration to blockscout_mcp_server/config.py when introducing a new external API endpoint.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/config.py : For paginated tools, add a dedicated page size configuration variable to blockscout_mcp_server/config.py.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/tools/*.py : When simplifying address objects in tool outputs, transform complex address objects into a single address string.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/server.py : Register each new tool in blockscout_mcp_server/server.py by importing the tool function and registering it with the MCP server using the @mcp.tool() decorator.

Learnt from: akolotov
PR: #148
File: blockscout_mcp_server/api/routes.py:44-52
Timestamp: 2025-07-11T00:58:37.475Z
Learning: Logging is not currently used in the blockscout/mcp-server codebase. Full logging support will be implemented in a separate issue. Print statements are acceptable temporarily until proper logging is implemented.

🧰 Additional context used
📓 Path-based instructions (3)
pyproject.toml

📄 CodeRabbit Inference Engine (.cursor/rules/010-implementation-rules.mdc)

If any new package needs to be installed it needs to be done with 'sudo which uv pip install --system ""' command. Don't forget to update pyproject.toml with the new package.

When updating the version of the MCP server, update the version field in the [project] section of pyproject.toml.

Files:

  • pyproject.toml
**/*.py

📄 CodeRabbit Inference Engine (.cursor/rules/000-role-and-task.mdc)

**/*.py: The MCP server must be implemented in Python, as you are a senior Python developer and the expertise is in Python.
The MCP server must wrap Blockscout APIs and expose blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol (MCP).
The MCP server must communicate with AI agents/chat applications through stdin.

**/*.py: Regular Python modules should generally not exceed 500 lines of code (LOC). If a module approaches this limit, consider splitting it into multiple focused modules (e.g., address_tools.py and address_tools_advanced.py) to maintain readability and logical organization.
ALL import statements must be placed at the top of the Python module, immediately after the module docstring (if present) and before any other code. Never insert imports inline near where the functionality is used. Follow PEP 8 import order.
ALL linting and formatting issues must be resolved before committing or pushing code. Use the Ruff rules defined in 300-ruff-lint-and-format.mdc to identify and fix issues.

**/*.py: Always run ruff check . --fix and ruff format . on generated code before suggesting commits or opening a PR
Avoid using # noqa: E501 for ordinary code lines; split long lines instead. Only use # noqa: E501 for docstrings or string literals that must exceed 120 characters.
Use Ruff to enforce a 120-character line length, compatible with Black formatting

Files:

  • blockscout_mcp_server/__init__.py
blockscout_mcp_server/__init__.py

📄 CodeRabbit Inference Engine (.cursor/rules/130-version-management.mdc)

When updating the version of the MCP server, update the __version__ variable in blockscout_mcp_server/__init__.py.

Files:

  • blockscout_mcp_server/__init__.py
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to blockscout_mcp_server/__init__.py : When updating the version of the MCP server, update the `__version__` variable in `blockscout_mcp_server/__init__.py`.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.532Z
Learning: Applies to **/*.py : The MCP server must wrap Blockscout APIs and expose blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol (MCP).
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Use the exact same version string in both `pyproject.toml` and `blockscout_mcp_server/__init__.py`.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-07-22T00:11:00.226Z
Learning: Read the project technical description in `SPEC.md` to clearly understand how the MCP server communicates with counterparties and important aspects of the server implementation before responding to a user request.
Learnt from: akolotov
PR: blockscout/mcp-server#148
File: blockscout_mcp_server/api/routes.py:44-52
Timestamp: 2025-07-11T00:58:37.475Z
Learning: Logging is not currently used in the blockscout/mcp-server codebase. Full logging support will be implemented in a separate issue. Print statements are acceptable temporarily until proper logging is implemented.
Learnt from: akolotov
PR: blockscout/mcp-server#142
File: blockscout_mcp_server/api/routes.py:242-258
Timestamp: 2025-07-10T19:21:50.271Z
Learning: The user akolotov prefers a unified tool registration approach where a single function registers tools in both MCP and REST API instead of having separate registration points in blockscout_mcp_server/server.py and blockscout_mcp_server/api/routes.py. This would eliminate duplication and reduce maintenance burden.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Update both `pyproject.toml` and `blockscout_mcp_server/__init__.py` simultaneously to maintain consistency across the codebase.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to pyproject.toml : When updating the version of the MCP server, update the `version` field in the `[project]` section of `pyproject.toml`.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/200-development-testing-workflow.mdc:0-0
Timestamp: 2025-07-22T00:13:24.809Z
Learning: Ensure your changes are well-tested by checking test coverage using pytest --cov=blockscout_mcp_server --cov-report=term-missing
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/config.py : For paginated tools, add a dedicated page size configuration variable to blockscout_mcp_server/config.py.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/tools/*.py : Do not expose individual pagination parameters (like page, offset, items_count) in tool signatures; use a single opaque cursor string.
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/config.py : Add new API endpoint configuration to blockscout_mcp_server/config.py when introducing a new external API endpoint.
pyproject.toml (10)

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to pyproject.toml : When updating the version of the MCP server, update the version field in the [project] section of pyproject.toml.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Update both pyproject.toml and blockscout_mcp_server/__init__.py simultaneously to maintain consistency across the codebase.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Use the exact same version string in both pyproject.toml and blockscout_mcp_server/__init__.py.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to blockscout_mcp_server/init.py : When updating the version of the MCP server, update the __version__ variable in blockscout_mcp_server/__init__.py.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.532Z
Learning: Applies to **/*.py : The MCP server must wrap Blockscout APIs and expose blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol (MCP).

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/200-development-testing-workflow.mdc:0-0
Timestamp: 2025-07-22T00:13:24.809Z
Learning: Ensure your changes are well-tested by checking test coverage using pytest --cov=blockscout_mcp_server --cov-report=term-missing

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/config.py : Add new API endpoint configuration to blockscout_mcp_server/config.py when introducing a new external API endpoint.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.532Z
Learning: Applies to **/*.py : The MCP server must be implemented in Python, as you are a senior Python developer and the expertise is in Python.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/server.py : Register each new tool in blockscout_mcp_server/server.py by importing the tool function and registering it with the MCP server using the @mcp.tool() decorator.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.532Z
Learning: Applies to {Dockerfile,docker-compose.yml} : The MCP server must be able to run locally or through Docker.

blockscout_mcp_server/__init__.py (12)

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to blockscout_mcp_server/init.py : When updating the version of the MCP server, update the __version__ variable in blockscout_mcp_server/__init__.py.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Use the exact same version string in both pyproject.toml and blockscout_mcp_server/__init__.py.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Update both pyproject.toml and blockscout_mcp_server/__init__.py simultaneously to maintain consistency across the codebase.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.662Z
Learning: Applies to pyproject.toml : When updating the version of the MCP server, update the version field in the [project] section of pyproject.toml.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/200-development-testing-workflow.mdc:0-0
Timestamp: 2025-07-22T00:13:24.809Z
Learning: Ensure your changes are well-tested by checking test coverage using pytest --cov=blockscout_mcp_server --cov-report=term-missing

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.532Z
Learning: Applies to **/*.py : The MCP server must wrap Blockscout APIs and expose blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol (MCP).

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/tools/*.py : Do not expose individual pagination parameters (like page, offset, items_count) in tool signatures; use a single opaque cursor string.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/config.py : Add new API endpoint configuration to blockscout_mcp_server/config.py when introducing a new external API endpoint.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/config.py : For paginated tools, add a dedicated page size configuration variable to blockscout_mcp_server/config.py.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/tools/*.py : When simplifying address objects in tool outputs, transform complex address objects into a single address string.

Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/110-new-mcp-tool.mdc:0-0
Timestamp: 2025-07-22T00:12:06.026Z
Learning: Applies to blockscout_mcp_server/server.py : Register each new tool in blockscout_mcp_server/server.py by importing the tool function and registering it with the MCP server using the @mcp.tool() decorator.

Learnt from: akolotov
PR: #148
File: blockscout_mcp_server/api/routes.py:44-52
Timestamp: 2025-07-11T00:58:37.475Z
Learning: Logging is not currently used in the blockscout/mcp-server codebase. Full logging support will be implemented in a separate issue. Print statements are acceptable temporarily until proper logging is implemented.

🔇 Additional comments (2)
pyproject.toml (1)

3-3: Version bump cross-checked and OK

0.6.1 matches the value in blockscout_mcp_server/__init__.py; no further action required.

blockscout_mcp_server/__init__.py (1)

3-3: Package version kept in sync

__version__ = "0.6.1" correctly mirrors pyproject.toml.

@akolotov akolotov merged commit 6b52721 into main Jul 23, 2025
8 checks passed
@akolotov akolotov deleted the fix/explicit-version-mcp-sdk branch July 23, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant