rest-mcp-server

princeautomationdestination/rest-mcp-server

3.2

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.

Tools
  1. generateToken

    Authenticate a user and generate a token

  2. fetchData

    Fetch data from API using GET

  3. postrequest

    Create a new resource using POST

  4. put_request

    Update a resource fully using PUT

  5. patch_request

    Update partially using PATCH

  6. 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 via POST
  • โœ๏ธ put_request: Full update of a resource using PUT
  • ๐Ÿฉน patch_request: Partial update using PATCH
  • โŒ delete_request: Delete a resource using DELETE
  • ๐Ÿค– 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.