Blank MCP Server
Go to CloudBase Platform to create MCP Server via the blank template
Introduction
This template is a basic MCP Server template that includes a complete MCP Server project. You can modify it based on this project to develop your own MCP Server.
This will introduce how to use this project code for local development, debugging, and deployment.
Download the code package
Click here to download the project code
Local Development and Debugging
Install Dependencies
npm i
Log in to the Command Line
The
@cloudbase/cli` requires login before use. Log in with your CloudBase account:
npm run login
Environment Variables
Rename .env.template
to .env.development
. This file defines the environment variables:
SKIP_VERIFY_ACCESS=true
: Setting this will skip token verification. The original token verification will only allow calls from tokens with API Key and super administrator identities.CLOUDBASE_ENVIRONMENT=your-env-id
: In CloudBase hosted online environments, the context includes the CloudBase environment ID. During local development, we provide the environment ID by setting this environment variable. Set an environment ID under your currently logged-in account.
Setting the
SKIP_VERIFY_ACCESS
environment variable facilitates local debugging, but it is not recommended to configure it in the online production environment.
Start the Local MCP Server Service
npm run dev
Once started, the service will be available at http://localhost:3000/messages.
Modifying the code will trigger recompilation and restart the service.
Start Graphical Interface Debugging
Run MCP Inspector:
npx @modelcontextprotocol/inspector
Go to http://localhost:6274/ for debugging.
- On the left, select the
Streamable HTTP
type and fill in theURL
ashttp://localhost:3000/messages
- Click
Connect
on the left - Under the
Tools
tab, clickList Tools
to display the tool list - Select any tool to invoke
Deploy to Cloud Hosting
Build
npm run build
Deploy
This MCP Server can be directly deployed to Cloud Hosting, but to use it in the Cloud Development Agent, you need to first create an MCP Server in the console and then overwrite its Cloud Hosting service.
First, go to the CloudBase Platform to create an MCP Server.
Once created, run the cli deployment command and fill in the corresponding MCP identifier.
npm run deploy