You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Running Simple Auth Github Example throws 404 error #679
MCP server "github-server" Error: SSE error: Non-200 status code (404)
MCP server "github-server" Connection failed: SSE error: Non-200 status code (404)
In the server output it shows:
INFO: Started server process [28396]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:3002 (Press CTRL+C to quit)
INFO: ::1:58316 - "GET / HTTP/1.1" 404 Not Found
To Reproduce
Steps to reproduce the behavior (instructions in README.md):
uv run mcp-simple-auth
claude mcp add to add server
claude, which throws error
See error
Expected behavior
The MCP server starting properly.
Desktop (please complete the following information):
So with inspector, I'm now getting the following (also using the latest server.py from a few days ago) (so 401 instead of 404):
New SSE connection. NOTE: The sse transport is deprecated and has been replaced by streamable-http
Query parameters: [Object: null prototype] {
url: 'http://localhost:8000/sse',
transportType: 'sse'
}
SSE transport: url=http://localhost:8000/sse, headers=Accept
Received 401 Unauthorized from MCP server: SSE error: Non-200 status code (401)
And on the server logs
INFO: Started server process [27494]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)
INFO: ::1:61155 - "GET /sse HTTP/1.1" 401 Unauthorized
INFO: ::1:61195 - "GET /sse HTTP/1.1" 401 Unauthorized
I get this after clicking "Connect" with the parameters below in the inspector.
I ran the inspector using npx @modelcontextprotocol/inspector uv run mcp-simple-auth
Eh ok, seeing the inspector issues indeed. But I'm still getting this 401 error also when using Claude Code. So that seems to be unrelated for this particular issue.
@ihrpr are you able to run the example without any problems then? (Just in Claude, Cursor, wherever)
I initially faced the same issue, now able to run with inspector.
Thanks for the fix!
However, I am now encountering a new issue with my simple client setup to communicate with the server
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'http://localhost:8000/sse' error
My client code :
from mcp import ClientSession
from mcp.client.sse import sse_client
import anyio
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
from mcp.shared.message import SessionMessage
from mcp.shared.session import RequestResponder
import mcp.types as types
import argparse
import logging
import sys
from functools import partial
from urllib.parse import urlparse
if not sys.warnoptions:
import warnings
warnings.simplefilter("ignore")
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("client")
async def message_handler(
message: RequestResponder[types.ServerRequest, types.ClientResult]
| types.ServerNotification
| Exception,
) -> None:
if isinstance(message, Exception):
logger.error("Error: %s", message)
return
logger.info("Received message from server: %s", message)
async def run_session(
read_stream: MemoryObjectReceiveStream[SessionMessage | Exception],
write_stream: MemoryObjectSendStream[SessionMessage],
client_info: types.Implementation | None = None,
):
async with ClientSession(
read_stream,
write_stream,
message_handler=message_handler,
client_info=client_info,
) as session:
logger.info("Initializing session")
await session.initialize()
logger.info("Initialized")
async def main():
async with sse_client("http://localhost:8000/sse") as (
read_stream,
write_stream,
_,
):
# Create a session using the client streams
async with ClientSession(read_stream, write_stream) as session:
# Initialize the connection
await session.initialize()
# List available tools
tools = await session.list_tools()
print("Available Tools:", tools)
# Call a tool
tool_result = await session.call_tool("get_user_profile")
if __name__ == "__main__":
anyio.run(main)
@ihrpr Could you please assist in resolving this error? Any guidance on how to handle authentication or properly configure my client would be greatly appreciated.
Activity
lukekulik commentedon May 12, 2025
I'm running into the same issue, could one of the maintainers take a look?
ihrpr commentedon May 17, 2025
@mopg have you tried running with inspector?
Please can you share the parameters you are using to set up the server?
mopg commentedon May 17, 2025
Thanks for help, @ihrpr!
So with inspector, I'm now getting the following (also using the latest server.py from a few days ago) (so 401 instead of 404):
And on the server logs
I get this after clicking "Connect" with the parameters below in the inspector.

I ran the inspector using
npx @modelcontextprotocol/inspector uv run mcp-simple-authThis is all using version
mcp==1.9.0.ihrpr commentedon May 19, 2025
thanks, there is Inspector issues we are looking at now: modelcontextprotocol/inspector#390
mopg commentedon May 19, 2025
Eh ok, seeing the inspector issues indeed. But I'm still getting this 401 error also when using Claude Code. So that seems to be unrelated for this particular issue.
@ihrpr are you able to run the example without any problems then? (Just in Claude, Cursor, wherever)
ihrpr commentedon May 19, 2025
yes, I can run with test clients as well as now with inspector (after the inspector fix)
Have you made any change to the server?
RamyaPrasad24 commentedon May 20, 2025
I initially faced the same issue, now able to run with inspector.
Thanks for the fix!
However, I am now encountering a new issue with my simple client setup to communicate with the server
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'http://localhost:8000/sse' errorMy client code :
@ihrpr Could you please assist in resolving this error? Any guidance on how to handle authentication or properly configure my client would be greatly appreciated.
Thank you!
felixweinberger commentedon Oct 3, 2025
Closing as initial inspector issue has been resolved.
If there's still an issue you're facing please feel free to reopen or open a new one with the detailed repro!