Skip to content

MCP Rest Server 实现如何支持更复杂的认证方式 #2161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Colstuwjx opened this issue May 2, 2025 · 3 comments
Open

MCP Rest Server 实现如何支持更复杂的认证方式 #2161

Colstuwjx opened this issue May 2, 2025 · 3 comments

Comments

@Colstuwjx
Copy link
Contributor

Why do you need it?

有看到例子里展示了可以在 request template 里配置一个 header 带上 api-key 的方式做鉴权,但是有些时候认证逻辑可能会更复杂一些,比如可能是先找一个 auth center 申请签发一个 jwt token 然后再来请求具体的 api ,这种情况下如果要把这些 rest api 接入到 higress mcp server 的话应该怎么做呢?

How could it be?

暂时还没什么好的想法,我理解要么就是支持注入脚本代码,在 mcp rest server 请求前跑这段脚本然后生成一段 output,作为请求的上下文使用,不过这样可能会搞的比较复杂。

Other related information

Add any other context or screenshots about the feature request here.

@804e
Copy link

804e commented May 8, 2025

这种场景很常见啊, 有办法实现吗? 旧有系统的认证方式还是很多样化的

@johnlanni
Copy link
Collaborator

会遵循 OAS3 规范里的几种认证方式先实现,其他的方式也可以进行扩展:
https://swagger.io/docs/specification/v3_0/authentication/

@804e
Copy link

804e commented May 9, 2025

会遵循 OAS3 规范里的几种认证方式先实现,其他的方式也可以进行扩展: https://swagger.io/docs/specification/v3_0/authentication/

我不是想新增认证方式, 是想调用网关后端服务之前, 先能自定义发起一个请求获取系统token, 然后把这个token放入实际的网关后端服务请求参数或者请求头中
@johnlanni

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants