piyushgithub15
MCP Serverpiyushgithub15public

todos api

这是一个受 Auth0 保护的示例 API,用于展示 MCP 服务器调用受保护 API 的能力。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
TypeScript
Language
-
License

About This Server

这是一个受 Auth0 保护的示例 API,用于展示 MCP 服务器调用受保护 API 的能力。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Todos API

This is a sample API which is protected by Auth0. It is used in the remote MCP demo to showcase the capabilities how the MCP server can be used to call a protected API on behalf of a user.

Note: While for this demo we are deploying the API to Cloudflare, it could be deployed anywhere.

Auth0 Configuration

In the Auth0 dashboard, create a new API in the APIs section.

Create API

Once the API is created, enable "Offline Access" so we can get a refresh token.

Enable Offline Access

Note: You can turn off the "Allow Skipping User Consent" if you want to force users to consent to the scopes.

And finally add the following API permissions:

  • read:todos
  • read:billing
Create Permissions

That's it! You can now configure your local environment or deploy the API to Cloudflare.

Development

Create a .dev.vars file in the root of the project with the following structure:

AUTH0_DOMAIN=yourtenant.us.auth0.com
AUTH0_AUDIENCE=urn:todos-api

The AUTH0_DOMAIN is the domain of the Auth0 tenant. The AUTH0_AUDIENCE is the audience of the API you created in the Auth0 tenant (eg: urn:todos-api).

Testing the API

To test the API, you can use the following command:

npm run dev

This will start the worker and you can make requests to it. In the Auth0 dashboard there is a Test tab in the API where you can get an access_token to call the API. Use this to call the API as follows:

curl --request GET \
  --url http://localhost:8788/api/me \
  --header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6Im...'

If this call is successful, you should see the claims of the JWT token in the response.

Deploying the API

To deploy the API to Cloudflare, you will first need to set the following secrets:

wrangler secret put AUTH0_DOMAIN
wrangler secret put AUTH0_AUDIENCE

Once the secrets are set, you can deploy the API with the following command:

npm run deploy

Quick Start

1

Clone the repository

git clone https://github.com/piyushgithub15/todos-api
2

Install dependencies

cd todos-api
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerpiyushgithub15
Repotodos-api
LanguageTypeScript
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation