princeautomationdestination/rest-mcp-server
If you are the rightful owner of rest-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This is a Node.js-based Model Context Protocol (MCP) server providing full CRUD operations over a REST API with authentication.
generateToken
Authenticate a user and generate a token
fetchData
Fetch data from API using GET
postrequest
Create a new resource using POST
put_request
Update a resource fully using PUT
patch_request
Update partially using PATCH
delete_request
Delete a resource using DELETE
๐ ๏ธ MCP REST API Server (CRUD + Auth)
This is a Node.js-based Model Context Protocol (MCP) server that provides full CRUD operations over a REST API using tools powered by Axios. It includes features like authentication, data creation, update (PUT/PATCH), fetch, and delete.
๐ฆ Features
- ๐
generateToken
: Authenticate a user and generate a token - ๐ฅ
fetchData
: Fetch data with optional query parameters - โ
postrequest
: Create a new resource viaPOST
- โ๏ธ
put_request
: Full update of a resource usingPUT
- ๐ฉน
patch_request
: Partial update usingPATCH
- โ
delete_request
: Delete a resource usingDELETE
- ๐ค LLM-compatible with Claude and others via MCP interface
๐ Project Structure
project/
โโโ index.js # Entry point
โโโ package.json
โโโ README.md
๐ Getting Started
1. Prerequisites
Ensure you have the following installed:
- Node.js (v18+)
- npm or yarn
2. Installation
npm install
Or manually install:
npm install axios zod @modelcontextprotocol/sdk
3. Running the Server
node index.js
You should see:
REST API MCP Server for full CRUD operations with authentication running on stdio
๐งช Available Tools
Each tool can be invoked via the MCP protocol interface:
โ
generateToken
Authenticate a user and generate a token
Params: baseURL
, endpoint
, username
, password
๐ฅ fetchData
Fetch data from API using GET
Params: baseURL
, endpoint
, params
(optional)
โ postrequest
Create a new resource using POST
Params: baseURL
, endpoint
, payload
(JSON string)
โ๏ธ put_request
Update a resource fully using PUT
Params: baseURL
, endpoint
, token
, payload
๐ฉน patch_request
Update partially using PATCH
Params: baseURL
, endpoint
, token
, payload
โ delete_request
Delete a resource using DELETE
Params: baseURL
, endpoint
, token
๐ค ๐๐จ๐ฐ ๐ญ๐จ ๐๐จ๐ง๐ง๐๐๐ญ ๐ญ๐ก๐ข๐ฌ ๐ฐ๐ข๐ญ๐ก ๐๐๐ ๐ฅ๐ข๐ค๐ ๐๐ฅ๐๐ฎ๐๐
To use this server as a tool with Claude (Anthropic) or other LLMs that support MCP, include the following configuration in your .mcp.json
or wherever your tooling is configured:
{
"mcpServers": {
"httpServer": {
"command": "npx",
"args": ["-y", "@princeautomationdestination/rest-mcp-server"]
}
}
}
๐ก๏ธ Error Handling
Every tool handles its own error and returns:
- Friendly message on failure
- JSON string of response data on success
- Full logs to
stderr
for debugging
๐ License
MIT License. Open for use, extension, and community contribution.
Let me know if you want a badge section, Dockerfile, or package.json
template to publish your MCP server to npm.