diff --git a/bin/build.ts b/bin/build.ts index 0187fe0..d209184 100644 --- a/bin/build.ts +++ b/bin/build.ts @@ -81,6 +81,6 @@ async function build() { console.log("🎉 Build complete!"); } -execSync("npm version patch", { stdio: 'inherit' }) +execSync("cd src && npm version patch", { stdio: 'inherit' }) build() diff --git a/icon.svg b/icon.svg deleted file mode 100644 index 9cd22ab..0000000 --- a/icon.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - mcp - - - \ No newline at end of file diff --git a/src/README.md b/src/README.md new file mode 100644 index 0000000..4a9ebdd --- /dev/null +++ b/src/README.md @@ -0,0 +1,74 @@ + +# n8n-nodes-openapi-mcp-server + +[![NPM version](https://img.shields.io/npm/v/n8n-nodes-openapi-mcp-server?style=flat-square)](https://www.npmjs.com/package/n8n-nodes-openapi-mcp-server) +[![NPM downloads](https://img.shields.io/npm/dm/n8n-nodes-openapi-mcp-server?style=flat-square)](https://www.npmjs.com/package/n8n-nodes-openapi-mcp-server) + +This is an n8n node that acts as a trigger, running an MCP (Machine-readable Capability Protocol) server inside n8n. It dynamically generates tools from an OpenAPI specification URL and makes them available via a webhook. + +## Installation + +To install this node, follow these steps: + +1. Go to your n8n instance. +2. Go to **Settings > Community Nodes**. +3. Click **Install** and enter `n8n-nodes-openapi-mcp-server`. +4. Click **Install** again. + +Alternatively, you can use npm in your n8n's custom nodes directory: + +```bash +npm install n8n-nodes-openapi-mcp-server +``` + +## Configuration + +The node has the following properties: + +- **Path**: The path for the webhook URL. Defaults to `mcp`. +- **OpenAPI URL**: The URL of the `openapi.json` file to generate tools from. +- **Default Filter**: An optional tag to filter the tools from the OpenAPI specification. +- **Available Tools**: A read-only list of the tools that have been successfully loaded from the OpenAPI URL. This list refreshes automatically when you open the node. + +### Credentials + +This node requires credentials to authenticate with the target API. + +- **Base URL**: The base URL of the API (e.g., `https://api.example.com`). +- **Bearer Token**: The Bearer token for authentication. + +## Usage + +This node functions as a webhook trigger. Once activated, it will provide a webhook URL. You can send MCP requests to this URL to interact with the tools generated from the OpenAPI specification. + +The node handles the following MCP methods: + +- `initialize`: Initializes the connection. +- `tools/list`: Lists all the available tools. +- `tools/call`: Executes a specific tool with the given arguments. +- `ping`: A simple ping to check the connection. + +When a `tools/call` request is received, the node will make an HTTP request to the corresponding API endpoint defined in the OpenAPI specification, using the provided credentials. + +## Example + +Here is an example of how to call the `tools/list` method using `curl`. Replace `YOUR_N8N_WEBHOOK_URL` with the actual webhook URL provided by the node. + +```bash +curl -X POST YOUR_N8N_WEBHOOK_URL \ +-H "Content-Type: application/json" \ +-d '{ + "jsonrpc": "2.0", + "id": "123", + "method": "tools/list", + "params": {} +}' +``` + +## Development + +Contributions are welcome. Please open an issue or a pull request on the project's repository. + +## License + +This project is licensed under the ISC License. diff --git a/src/packege.json b/src/packege.json new file mode 100644 index 0000000..84102a8 --- /dev/null +++ b/src/packege.json @@ -0,0 +1,23 @@ +{ + "name": "n8n-nodes-openapi-mcp-server", + "version": "1.1.19", + "keywords": [ + "n8n", + "n8n-nodes" + ], + "author": { + "name": "makuro", + "phone": "6289697338821" + }, + "license": "ISC", + "description": "", + "n8n": { + "nodes": [ + "nodes/OpenapiMcpServer.js" + ], + "n8nNodesApiVersion": 1, + "credentials": [ + "credentials/OpenapiMcpServerCredentials.credentials.js" + ] + } +} \ No newline at end of file diff --git a/x.sh b/x.sh deleted file mode 100644 index bf4d769..0000000 --- a/x.sh +++ /dev/null @@ -1,2 +0,0 @@ -curl -X POST "https://n8n.wibudev.com/form/82848bc4-5ea2-4e5a-8bb6-3c09b94a8c5d" \ - -F "file=@/Users/bip/Downloads/bank_data_darmasaba.pdf"