mcp-server-oauth-toy

MCP其他

提供方 bvolpato

其他 Streamable HTTP OAuth 授权 社区 / 第三方
查看接入方式

An MCP server for testing OAuth support in MCP clients, implementing OAuth 2.0 authorization code flow with PKCE and dynamic client registration, providing whoami and echo tools for developers to verify OAuth integration.

一句话选型结论

按资料字段整理

mcp-server-oauth-toy 属于其他类 MCP 服务器,Streamable HTTP,OAuth 授权,有可直接复制的远程端点配置。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类其他 传输方式Streamable HTTP 鉴权OAuth 授权 部署方式支持远程部署
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

其他
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

Blend Deployment OAuth 2.0 MCP Protocol Python Authorization Code Flow PKCE Dynamic Client Registration mcp-cli Integration Developer Testing

适用场景

Blend DeploymentOAuth 2.0MCP Protocol

安装与配置

Streamable HTTP OAuth 授权
新一代远程传输,替代 SSE
http://localhost:8000/mcp

把它填进客户端的 MCP 配置即可,不需要在本地安装运行时。

  1. 1
    准备运行环境

    确认你的客户端支持远程端点,并拿到服务地址。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
接入外部数据

把外部系统的数据接进对话。

自动化重复操作

把固定步骤交给模型跑。

补充工具能力

给模型补上它原本没有的能力。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。

先想清楚的地方

  • 远程端点依赖网络与服务方可用性,注意密钥与调用额度。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在其他场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
mcp-server-oauth-toy当前 未标注 Streamable HTTP 支持远程部署 有 2026-11-14
gemini-cli 未标注 stdio · 本地进程 本地部署 有 2026-04-13
ext-apps 未标注 stdio · 本地进程 本地部署 有 2026-04-19
northcinder 未标注 stdio · 本地进程 本地部署 有 2026-08-23
fastctx 未标注 stdio · 本地进程 本地部署 有 2026-08-23
quickstart-resources 未标注 stdio · 本地进程 本地部署 有 2026-04-12

服务器档案

其他
字段来自项目仓库与公开索引,中文说明由本站标注
提供方bvolpato上游标注的维护方 bvolpato
分类其他本站按上游分类展示
连接方式Streamable HTTP新一代远程传输,替代 SSE
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · python本地安装时用到的包标识与运行时
部署类型支持远程部署上游给出的部署形态
最近核验2026-11-14上游最后核验时间

详细介绍

4.3 KB
来自项目仓库与上游目录的原文,未做删改

MCP Server OAuth Toy

A simple MCP (Model Context Protocol) server with OAuth 2.0 authentication for testing the OAuth support in mcp-cli.

Features

  • Full OAuth 2.0 Authorization Code flow with PKCE
  • Dynamic client registration (RFC 7591)
  • In-memory session storage (for testing)
  • Browser-based authorization where users enter their name
  • Two tools: whoami (returns authenticated user) and echo (echoes message with user name)

Quick Start

1. Start the Server (Docker)```bash

Clone the repository

git clone https://github.com/bvolpato/mcp-server-oauth-toy.git
cd mcp-server-oauth-toy

Build and run with Docker

docker build -t mcp-server-oauth-toy .
docker run -p 8000:8000 mcp-server-oauth-toy


### 2. Configure mcp-cli

Add to your `~/.config/mcp/mcp_servers.json`:```json
{
  "mcpServers": {
    "oauth-toy": {
      "url": "http://localhost:8000/mcp",
      "oauth": true
    }
  }
}

3. Test with mcp-cli```bash

Install mcp-cli (requires Bun)

bun install -g @philschmid/mcp-cli

List available tools (will trigger OAuth flow on first run)

mcp-cli -c ~/.config/mcp/mcp_servers.json oauth-toy

Call the whoami tool

mcp-cli -c ~/.config/mcp/mcp_servers.json oauth-toy/whoami '{}'

Call the echo tool

mcp-cli -c ~/.config/mcp/mcp_servers.json oauth-toy/echo '{"message": "Hello!"}'


## OAuth Flow

When you first connect to the server:

1. mcp-cli detects the server requires OAuth (401 response)
2. mcp-cli discovers OAuth endpoints via `/.well-known/oauth-authorization-server`
3. mcp-cli registers as a client via `/register` (dynamic registration)
4. Your browser opens to the authorization page
5. You enter your name and click "Authorize"
6. mcp-cli receives the authorization code and exchanges it for tokens
7. Subsequent requests use the stored access token

## Tools

### `whoami`

Returns the name of the authenticated user.```bash
mcp-cli -c ~/.config/mcp/mcp_servers.json oauth-toy/whoami '{}'
# Output: You are authenticated as: Alice

echo

Echoes back the provided message with the authenticated user's name.```bash
mcp-cli -c ~/.config/mcp/mcp_servers.json oauth-toy/echo '{"message": "Hello!"}'

Output: Alice says: Hello!


## Local Development

### Using uv```bash
# Install dependencies
uv sync

# Run the server
uv run python -m mcp_server_oauth_toy

Using Docker Compose```bash

docker-compose up


## OAuth Endpoints

| Endpoint | Description |
|----------|-------------|
| `/.well-known/oauth-authorization-server` | OAuth 2.0 Authorization Server Metadata |
| `/register` | Dynamic Client Registration |
| `/authorize` | Authorization endpoint (shows login form) |
| `/token` | Token endpoint |

## MCP Endpoints

| Endpoint | Description |
|----------|-------------|
| `/mcp` | MCP over Streamable HTTP |
| `/health` | Health check |

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `HOST` | `0.0.0.0` | Server host |
| `PORT` | `8000` | Server port |
| `BASE_URL` | `http://localhost:8000` | Public base URL |
| `REDIS_URL` | (none) | Redis URL for persistent storage (e.g., Upstash) |
| `KV_URL` | (none) | Alternative Redis URL (Vercel KV) |

## Persistent Storage (for Serverless)

By default, the server uses in-memory storage which doesn't persist across serverless function invocations. For production use on Vercel, set up Redis:

### Using Upstash (Recommended)

1. Create a free Redis database at upstash.com
2. Copy the `UPSTASH_REDIS_REST_URL`
3. Add it as `REDIS_URL` in your Vercel environment variables

### Using Vercel KV

1. Add Vercel KV to your project from the Vercel dashboard
2. The `KV_URL` environment variable is automatically set

## Testing the PR

This server was created to test mcp-cli PR #18 which adds OAuth support.

To test the OAuth implementation:

1. Start this server locally
2. Use mcp-cli with the `oauth: true` configuration
3. Complete the browser-based authorization
4. Verify the `whoami` tool returns your name

## Deploy to Vercel

1. Click the button above or import the repo at vercel.com/new
2. Select **"Other"** as the framework (Vercel auto-detects Python)
3. Deploy!

The `BASE_URL` is automatically set from `VERCEL_URL`.

Then update your mcp_servers.json:```json
{
  "mcpServers": {
    "oauth-toy": {
      "url": "https://your-deployment.vercel.app/mcp",
      "oauth": true
    }
  }
}

License

MIT

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
mcp-server-oauth-toy 怎么安装?

在客户端按下面的安装命令接入:http://localhost:8000/mcp。装完在客户端配置里引用同一个包或端点。

mcp-server-oauth-toy 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

mcp-server-oauth-toy 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

mcp-server-oauth-toy 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

mcp-server-oauth-toy 能提供哪些能力?

资料显示能力标签包括 Blend Deployment、OAuth 2.0、MCP Protocol、Python、Authorization Code Flow、PKCE。具体工具清单以官方文档为准。

mcp-server-oauth-toy 需要什么运行环境?

运行时为 python;属于远程端点,不需要在本地装运行时。

mcp-server-oauth-toy 是本地还是远程?

它是远程端点,连服务地址即可。传输方式为Streamable HTTP。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-11-14。