
lieta mcp example
一个使用 Bearer Token 认证连接 MCP 服务器的客户端示例。
Repository Info
About This Server
一个使用 Bearer Token 认证连接 MCP 服务器的客户端示例。
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
MCP Client Example
This is an example MCP client that connects to MCP server with Bearer token authentication.
Prerequisites
- Node.js 22 or later
- npm or yarn
Setup
- Install dependencies:
npm install
- Create a
.envfile in the project root and add your Bearer token:
BEARER_TOKEN=your_token_here
MCP_SERVER_URL=your_server_url_here
Building and Running
- Build the TypeScript code:
npm run build
- Run the client:
npm start
Features
The example client demonstrates:
- Connecting to the MCP server with Bearer token authentication
- Listing available tools
Error Handling
The client includes basic error handling and will:
- Validate the presence of the Bearer token
- Handle connection errors
- Properly close the connection when done
Development
To modify the example:
- Edit the code in
src/index.ts - Rebuild with
npm run build - Run with
npm start
Quick Start
Clone the repository
git clone https://github.com/shamenchens/lieta-mcp-exampleInstall dependencies
cd lieta-mcp-example
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.