MariaDB / MariaDB/mcp

Recent changes in asyncmy break MariaDB MCP

Open
#61 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
204
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Recent commits in asyncmy (https://github.com/long2ice/asyncmy/commits/main) have changed internal connection fields accessed by MariaDB MCP. The MCP server starts up, but any tool call generates the following exception:

ERROR - Unexpected error during query execution (Connection: not acquired): 'SafeConnection' object has no attribute '_reader'
Traceback (most recent call last):
  File "/home/user/mariadb-mcp/src/server.py", line 259, in _execute_query
    async with self.pool.acquire() as conn:
  File "/home/user/mariadb-mcp/.venv/lib/python3.11/site-packages/asyncmy/contexts.py", line 75, in __aenter__
    self._conn = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "asyncmy/pool.pyx", line 118, in _acquire
  File "asyncmy/pool.pyx", line 120, in asyncmy.pool.Pool._acquire
  File "/home/user/mariadb-mcp/src/custom_connection.py", line 72, in fill_free_pool
    if conn._reader.at_eof() or conn._reader.exception():
       ^^^^^^^^^^^^
AttributeError: 'SafeConnection' object has no attribute '_reader'
2026-08-07 12:07:48,816 - config - ERROR - TOOL ERROR: list_databases failed: An unexpected error occurred: 'SafeConnection' object has no attribute '_reader'
Traceback (most recent call last):
  File "/home/user/mariadb-mcp/src/server.py", line 259, in _execute_query
    async with self.pool.acquire() as conn:
  File "/home/user/mariadb-mcp/.venv/lib/python3.11/site-packages/asyncmy/contexts.py", line 75, in __aenter__
    self._conn = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "asyncmy/pool.pyx", line 118, in _acquire
  File "asyncmy/pool.pyx", line 120, in asyncmy.pool.Pool._acquire
  File "/home/user/mariadb-mcp/src/custom_connection.py", line 72, in fill_free_pool
    if conn._reader.at_eof() or conn._reader.exception():
       ^^^^^^^^^^^^
AttributeError: 'SafeConnection' object has no attribute '_reader'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/mariadb-mcp/src/server.py", line 379, in list_databases
    results = await self._execute_query(sql)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/mariadb-mcp/src/server.py", line 295, in _execute_query
    raise RuntimeError(f"An unexpected error occurred: {e}") from e

I can confirm that downgrading asyncmy to 0.2.11 "solves" the problem, so the issue must be caused by recent changes to asyncmy.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/custom_connection.py at fill_free_pool, especially the access to conn._reader, and compare that assumption with the recent asyncmy connection changes. Reproduce the failure through a database tool such as list_databases and verify that pool acquisition and tool calls work with the affected asyncmy version without the AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.