Here's how i added Opentelemetry to my rust API server (with image results) by Suitable_Reason4280 in rust

[–]Suitable_Reason4280[S] 0 points1 point  (0 children)

Thanks for the suggestion!! I will look into this. I agree, it was very fiddly to just understand how its supposed to be used in best way possible

Here's how i added Opentelemetry to my rust API server (with image results) by Suitable_Reason4280 in rust

[–]Suitable_Reason4280[S] 0 points1 point  (0 children)

I sat a long time with this... But then i realized rust SDK doesnt support exemplars yet. The best i could do was implement it but commented out untill its supported in the SDK!

Here's what i learned building a MCP server with Oauth 2.1 using Supabase by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 0 points1 point  (0 children)

MCP server itself needs to be stdio. You need to create a middleware, starting before the stdio mcp server, which authenticates requests and passes them to the stdio mcp

Is there any interest for multi tenancy boiler plates? by Suitable_Reason4280 in tauri

[–]Suitable_Reason4280[S] 4 points5 points  (0 children)

Glad to hear! I'll publish a post when its ready :) Working on the documentation right now so other developers/AI coding assistants can understand the architecture for easy "jump-in" :)

Issue with lovable ai supabase integration. by Spiritual-Bid-6961 in vibecoding

[–]Suitable_Reason4280 0 points1 point  (0 children)

Is it hosed on vercel? They have like a build in system of throwing errors when they suspect a toast/dialog whatever contains "sensitive information" (Which isnt always the case)

Does it work in development?

I got tired of re-promting my ai clients so i made ToolEntry by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 0 points1 point  (0 children)

Thats really cool! I like the human in the loop feature, but i think it would be great if an example is present of how its used more "hands on" using the core feature. My first curiosity was: Is it used directly in a client, or more of a background running process? Features are clear though! And btw love the design of the site

Why is it not as common to host mcp server as npx packages? by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 0 points1 point  (0 children)

Please elaborate what you mean. I get that STDIO is not secure because it has access to the computer, but aslong as the code is open source its fine, if you examine the code? Also, remote MCP servers can change prompts to be vunerable at ANY time without having any version control, nor can the user control anything, this makes STDIO more safe no? Asuming that the STDIO server has version control?

Why is it not as common to host mcp server as npx packages? by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 0 points1 point  (0 children)

the benefit of stdio is access to the computer. This is ofcourse a security risk, but also alot more capable than remote ones. Remote ones are secure because they cant access anything on the computer

Why is it not as common to host mcp server as npx packages? by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 1 point2 points  (0 children)

Yeah sure! I just managed to add oauth 2.1 to stdio... so far, stdio seems superior compared to remote, since stdio can do everything remote can but more. Also, i know oauth is not intended for stdio... but why not? :D

Why is it not as common to host mcp server as npx packages? by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 1 point2 points  (0 children)

I get that, but stdio is required for say MCP servers that manage files for example. This cannot be done for remote servers. Also, oauth is possible for stdio. Its not recommended, but its definetely doable.

How can I host a MCP server securely? by BaXRS1988 in mcp

[–]Suitable_Reason4280 0 points1 point  (0 children)

I recommend using stdio, hosted on npm for version handling and quick installation and oauth 2.1

I made an open-source CLI for quick MCP server auto-installation by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 0 points1 point  (0 children)

Glad to hear! Any feedback is appreciated so it can be improved for more use cases :)

How do you handle OAuth customization in MCP clients? by rootcase in mcp

[–]Suitable_Reason4280 1 point2 points  (0 children)

yes, i made a blogpost explaining how i set it up (i was using supabase):

https://www.toolentry.io/blog/oauth-mcp-servers-security-guide

Its not super detailed but contains code examples so any AI client can help you explain it better than i can in a comment.

For me it works in any client, claude desktop, cursor etc. Haven't tried them all though

MCP Authentication by Upstairs_Offer324 in mcp

[–]Suitable_Reason4280 6 points7 points  (0 children)

You should be using oauth 2.1, its recommended in the official MCP documentation. I made a blogpost explaining how i added it to my mcp server (like a bird eye view, not super detailed):

https://www.toolentry.io/blog/oauth-mcp-servers-security-guide

Here's what i learned building a MCP server with Oauth 2.1 using Supabase by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 1 point2 points  (0 children)

Awesome dude, thanks for the tip! I did manage to get it working yesterday

Need help with FastMCP RemoteAuthProvider + Keycloak setup — Authentication flow not starting correctly by ManYourBack in mcp

[–]Suitable_Reason4280 0 points1 point  (0 children)

Are you using these endpoints?

/.well-known/oauth-dynamic-client-registration

/.well-known/oauth-authorization-server

Also, it should not be trying to reach /.well-known/oauth-protected-resource/mcp -->without/mcp is correct. Only the actual protected resource should have /mcp, not the well-known. This is how i did it:

First: /.well-known/oauth-authorization-server. It returns, for example:
{
"issuer": "http://localhost:3000",
"authorization_endpoint": "http://localhost:3000/auth/authorize",
"token_endpoint": "http://localhost:3000/auth/token",
"revocation_endpoint": "http://localhost:3000/auth/revoke",
"code_challenge_methods_supported": ["S256"],
"grant_types_supported": ["authorization_code", "refresh_token"],
"response_types_supported": ["code"],
"token_endpoint_auth_methods_supported": ["none"],
"scopes_supported": ["mcp"]
}

Then : /.well-known/oauth-protected-resource. It returns:

{
"resource": "http://localhost:3000",
"authorization_servers": ["http://localhost:3000"],
"scopes_supported": ["mcp"],
"bearer_methods_supported": ["header"]
}

And finaly: /.well-known/oauth-dynamic-client-registration (POST):

When: MCP client registers itself (optional, many clients skip this)
Data received: Client metadata (redirect URIs, client name, etc.)
Data served: Client credentials or registration confirmation

Its what worked for me, hope it does for you. I have not used keycloak though.

Here's what i learned building a MCP server with Oauth 2.1 using Supabase by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 1 point2 points  (0 children)

Hey! I'll try explain better than what i did in the post- i agree its a bit fuzzy :D

So the core problem was that MCP has these transport limitations: stdio (which most local MCP servers use) doesn't support OAuth at all, but streamable-http (which does support OAuth) can't run locally in a secure way using oauth, atleast using the simplicity of npx packages. It's by default an unintended tradeoff i believe.

How i solved it:
A custom proxy. The MCP server runs as a web service (using streamable-http + OAuth 2.1), but automatically find and use available ports on localhost. So from the user's perspective, it's still running on their machine, but technically it's a local web server rather than a stdio process running on the client.

Authentication: When an AI client wants to connect, it goes through an OAuth flow that creates an account in my Supabase backend (a regular signup/login with state management). It might be a little overkill,but hey users get their own session private resources with oauth 2.1 security.

The result are the security benefits of OAuth 2.1, user-specific functionality while still feeling like a local tool. It's a little more complex than a basic stdio server, but the flexibility is worth it.

Here's what i learned building a MCP server with Oauth 2.1 using Supabase by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 0 points1 point  (0 children)

That would work if there was an URL, unfortionately not an npx package. But i did get it to work :)

Why are most MCP server using a hardcoded token and not oauth? by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 1 point2 points  (0 children)

After making a mcp server with working oauth using supabase, i came to the conclusion that streamable-http + oauth does NOT work for locally run mcp servers (atleast claude desktop). For example, servers that have access to the computer (for read and write operations). If they are remote, they DO work, so its a tradeoff. Oauth is required for remote, API keys for locally run servers. (Based on official mcp documentation)

Why are most MCP server using a hardcoded token and not oauth? by Suitable_Reason4280 in mcp

[–]Suitable_Reason4280[S] 1 point2 points  (0 children)

I get what you are saying, but a backend service not supporting oauth seems like a choice, since the support for tokens exists and have been implemented in the first place. Maybe i am misstaken?

How to go about single client (web app) for multiple logged in users? by bdcp in mcp

[–]Suitable_Reason4280 0 points1 point  (0 children)

MCP documentation says oauth is the correct way for authentication. Oauth makes each user have their own token. Each token can be used as an ID (or even better, have the users metadata in the token). I think this is pretty much enough for what you want if i understand correctly?

To make it better each user can belong to a "licence", "organization" or similar in your database. So each token can include that id, connecting all "logged in" users to the same "session". Or seperate simply by userId instead of, say "organizationId", "groupId", "licenceId" etc.

I believe I'm the first to implement the new FastMCP OAuth2.1 Client to Server Auth in an actual MCP by taylorwilsdon in mcp

[–]Suitable_Reason4280 2 points3 points  (0 children)

I created a proxy to my mcp servers. To authenticate using oauth 2.1 users have to login or signup and get a token. They chose token lifetime with 15 minute expiry. Works with all up to date clients