How to Intermediate · 3 min read

MCP server not showing tools fix

Quick answer
To fix MCP server not showing tools, ensure you properly register your tools with the Server instance before starting it. Also, use the stdio_server transport or another supported transport to enable tool visibility and communication.

PREREQUISITES

  • Python 3.8+
  • pip install mcp
  • Basic knowledge of Python async programming

Setup MCP environment

Install the mcp Python package and prepare your environment variables if needed. MCP requires Python 3.8 or higher.

bash
pip install mcp

Step by step MCP server with tools

Register your tools explicitly with the Server instance and start the server using the stdio_server transport to ensure tools are visible and accessible.

python
import asyncio
from mcp.server import Server
from mcp.server.stdio import stdio_server

# Define a simple tool
async def echo_tool(input_text: str) -> str:
    return f"Echo: {input_text}"

async def main():
    # Create MCP server instance
    server = Server()

    # Register tools explicitly
    server.register_tool("echo", echo_tool)

    # Start the server with stdio transport
    await stdio_server(server)

if __name__ == "__main__":
    asyncio.run(main())

Common variations

  • Use different transports like SSE or TCP if stdio is not suitable.
  • Register multiple tools by calling server.register_tool() multiple times.
  • Use synchronous tools by wrapping them with asyncio.to_thread if needed.
python
import asyncio
from mcp.server import Server
from mcp.server.stdio import stdio_server

# Synchronous tool example
def sync_tool(data: str) -> str:
    return data.upper()

async def main():
    server = Server()

    # Wrap sync tool for async
    async def async_sync_tool(data: str) -> str:
        return await asyncio.to_thread(sync_tool, data)

    server.register_tool("uppercase", async_sync_tool)

    await stdio_server(server)

if __name__ == "__main__":
    asyncio.run(main())

Troubleshooting

  • If tools do not appear, verify you called server.register_tool() before starting the server.
  • Ensure you use the correct transport like stdio_server which supports tool communication.
  • Check for exceptions during tool registration or server start; unhandled exceptions can prevent tools from showing.
  • Confirm your client or agent supports MCP and is connected properly to the server.

Key Takeaways

  • Always register tools with server.register_tool() before starting the MCP server.
  • Use stdio_server or a supported transport to enable tool visibility and communication.
  • Wrap synchronous tools with asyncio.to_thread for async compatibility.
  • Check for exceptions during server startup to avoid silent failures hiding tools.
  • Verify client compatibility and connection to the MCP server for proper tool listing.
Verified 2026-04
Verify ↗