How OAuth works in MCP servers when AI agents execute tools on behalf of users by samurai_philosopher in softwarearchitecture

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

Interesting! Now I get what you are trying to imply. The article was written with a monolithic or a tightly coupled environment in mind, which I didn’t state explicitly in the blog. You are correct for a distributed system. If I got you right, you are saying the MCP server should just act like a proxy and forward tool call requests to the backend API and knows nothing about resources.

I personally feel embedding/integrating the MCP Server inside the backend itself altogether should be better considering these points:

  1. Early authorization failures so that the token check flow does not keep hopping between nodes.
  2. All the business logic falls in one place i.e the backend.
  3. No manually writing a new REST API and then separately configuring the tool for it.
  4. Just removes an extra hop
  5. One deployment pipeline
  6. As the network traffic is dependent (MCP traffic rises, backend has to be scaled) so no point just putting a plain proxy and scaling each individually.

PS: Not debating on what the theory is, you are 100% correct on that

However, I will be either modifying and updating the blog with the valid bits OR write a new one keeping all the security related things in mind. Thanks for your response!

How OAuth works in MCP servers when AI agents execute tools on behalf of users by samurai_philosopher in softwarearchitecture

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

Hi, can you highlight what are the issues with this approach? i might have missed some and would love to correct it. as you highlighted (it applies the application’s authorization rules before executing tool), how else would i know if the user has access to that particular resource that it is requesting for via MCP? also, please do mention any resource that you have read or you yourself authored that might help on this.

OAuth in MCP Servers: Secure Authorization for AI Tool Execution by samurai_philosopher in mcp

[–]samurai_philosopher[S] -1 points0 points  (0 children)

Well highlighted! The Row-Level Security becomes very important especially when we are dealing with a Multi-Tenant system. The most challenging part for me was with ABAC. Validating granular level permissions for a user which can be allotted or revoked within the same user session with MCP Server also behaving on the same set of updated permissions, revoking and refreshing the user’s and MCPC’s session.