@api-now/mcp 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.md ADDED
@@ -0,0 +1,15 @@
1
+ # API Now Ecosystem License
2
+
3
+ Copyright (c) 2025 API Now
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to use, copy, modify, merge, publish, and distribute the Software **exclusively within the API Now ecosystem**.
6
+
7
+ **Restrictions:**
8
+
9
+ - The Software may not be used, copied, modified, merged, published, or distributed outside of the API Now ecosystem.
10
+ - The Software may not be sublicensed, sold, or used as part of any product or service that is not part of the API Now ecosystem.
11
+ - Any use of the Software outside the API Now ecosystem is strictly prohibited.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+
15
+ For questions about permitted use, please contact: <info@apinow.app>
package/README.md ADDED
@@ -0,0 +1,174 @@
1
+ # API Now! Model Context Protocol (MCP) Server
2
+
3
+ [![NPM Version](https://img.shields.io/npm/v/@api-now/mcp.svg)](https://www.npmjs.com/package/@api-now/mcp)
4
+ [![License](https://img.shields.io/npm/l/@api-now/mcp.svg)](https://github.com/api-now/mcp/blob/main/LICENSE.md)
5
+
6
+ An official [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for the **API Now!** platform. This server acts as a programmatic bridge enabling LLMs and AI agents (such as Claude Desktop, Cursor, or VS Code) to manage, design, and deploy no-code API schemas directly from their chat environment.
7
+
8
+ ---
9
+
10
+ ## Architecture Overview
11
+
12
+ The API Now! platform provides an AI-first API design and management control plane using two core schemas:
13
+
14
+ 1. **Data Domain Models**: Representation of data entities, namespaces, structures, validation rules, and semantics.
15
+ 2. **API Models**: Expositions of the data domain to the public web (CRUD endpoints, path layouts, security rules, sessions, authorization, pagination, and rate limiting).
16
+
17
+ This MCP server translates high-level agent instructions into precise modifications on these models, validating changes locally using the `@api-now/core` package before patching them back to the control plane.
18
+
19
+ ---
20
+
21
+ ## Tool Directory
22
+
23
+ The server exposes tools grouped into five distinct areas.
24
+
25
+ ### 1. Authentication Tools (`registerAuthTools`)
26
+
27
+ Manage connection profiles and session credentials with the API Now! platform.
28
+
29
+ - `configure_auth`: Updates token, base API URL, and default organization. Validates credentials with the control plane before persisting.
30
+ - `get_auth_status`: Checks connection status and displays current user info and active organization.
31
+
32
+ ### 2. Data Domain Tools (`registerDomainTools`)
33
+
34
+ Operate on schemas defining data entities, properties, associations, namespaces, and semantics.
35
+
36
+ - **Domain Management**: `create_domain`, `read_domain`, `search_domains`, `update_domain`, `delete_domain`.
37
+ - **Structural Elements**:
38
+ - `add_namespace`, `update_namespace`, `remove_namespace`
39
+ - `add_model`, `update_model`, `remove_model`
40
+ - `add_entity`, `update_entity`, `remove_entity`
41
+ - `add_property`, `update_property`, `remove_property`
42
+ - `add_association`, `update_association`, `remove_association`
43
+ - **Data Semantics & IntelliSense**:
44
+ - `list_intelisense_helpers`: Lists available behaviors/helper modules to enrich domain logic.
45
+ - `apply_intelisense_helper`: Enriches properties on an entity with semantic traits.
46
+ - **Deletion & Removal Impact Analysis**:
47
+ - `analyze_domain_deletion_impact`: Evaluates data integrity impacts prior to removing components.
48
+ - `analyze_foreign_domain_removal_impact`: Assesses impact of removing external data domain dependencies.
49
+
50
+ ### 3. API Modeling Tools (`registerApiTools`)
51
+
52
+ Design endpoints, expose domain entities, configure security, and manage schema migrations.
53
+
54
+ - **API Management**: `create_api_model`, `read_api_model`, `search_api_models`, `update_api_model`, `delete_api_model`.
55
+ - **Configurations**:
56
+ - `attach_domain_to_api`: Binds a published catalog data domain version to the API.
57
+ - `configure_api_session`: Sets up authentication methods (OAuth, Token, Session secret), cookies, JWTs, and global pagination.
58
+ - `configure_api_rules`: Declares API-wide access policies, rate limits, and metadata (licenses, contact info).
59
+ - **Exposing Entities**:
60
+ - `expose_entity`: Projects a data entity into an API endpoint resource path.
61
+ - `update_exposed_entity`: Changes pagination settings or paths.
62
+ - `remove_exposed_entity`: Un-exposes an entity and its nested children from the API.
63
+ - **Endpoint Actions**:
64
+ - `add_entity_action`, `update_entity_action`, `remove_entity_action`: Configures supported HTTP actions (Create, Read, Update, Delete, List, Search) with action-level security policies and pagination overrides.
65
+ - **Safe Domain Upgrades**:
66
+ - `analyze_api_domain_update`: Checks compatibility of a new data domain version against exposed API endpoints and returns a `DomainUpdateReport`. It caches the report under a short-lived key to save tokens.
67
+ - `apply_api_domain_update`: Safely executes the schema migration using the cached `reportKey`.
68
+
69
+ ### 4. Catalog Tools (`registerCatalogTools`)
70
+
71
+ Inspect and search domain schemas published on public or organization-level catalogs.
72
+
73
+ - `list_catalogs`: Fetches accessible catalog domains.
74
+ - `search_public_catalog`: Searches public catalog definitions.
75
+ - `publish_catalog`: Publishes an immutable version of a domain model to the catalog.
76
+
77
+ ### 5. Utility Tools (`registerUtilityTools`)
78
+
79
+ Shared utilities for key generation.
80
+
81
+ - `generate_key`: Generates a standard Nanoid key compliant with API Now! core models. (Agents should always pre-generate keys through this tool or rely on tool responses instead of inventing random IDs).
82
+
83
+ ---
84
+
85
+ ## Installation
86
+
87
+ Install the package globally or locally in your workspace:
88
+
89
+ ```bash
90
+ npm install @api-now/mcp
91
+ # or globally
92
+ npm install -g @api-now/mcp
93
+ ```
94
+
95
+ ---
96
+
97
+ ## Configuration & Integration
98
+
99
+ The server runs as a standard MCP server communicating over standard input/output (stdio).
100
+
101
+ ### 1. Claude Desktop Integration
102
+
103
+ Add the server to your Claude Desktop configuration file:
104
+
105
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
106
+ - **Linux**: `~/.config/Claude/claude_desktop_config.json`
107
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
108
+
109
+ ```json
110
+ {
111
+ "mcpServers": {
112
+ "api-now": {
113
+ "command": "npx",
114
+ "args": ["-y", "@api-now/mcp"],
115
+ "env": {
116
+ "APINOW_TOKEN": "your-personal-access-token",
117
+ "APINOW_ORG": "your-default-org-id"
118
+ }
119
+ }
120
+ }
121
+ }
122
+ ```
123
+
124
+ ### 2. Cursor Integration
125
+
126
+ To use this with Cursor:
127
+
128
+ 1. Open Cursor Settings -> **Features** -> **MCP**.
129
+ 2. Click **+ Add New MCP Server**.
130
+ 3. Fill in the details:
131
+ - **Name**: `API Now`
132
+ - **Type**: `stdio`
133
+ - **Command**: `npx -y @api-now/mcp`
134
+ - **Environment Variables**: Add `APINOW_TOKEN` and `APINOW_ORG` if preferred (the server can also be configured dynamically in-session via `configure_auth`).
135
+
136
+ ---
137
+
138
+ ## Local Development
139
+
140
+ If you want to build and modify the server locally:
141
+
142
+ ### Prerequisites
143
+
144
+ - Node.js (v18 or higher)
145
+ - npm
146
+
147
+ ### Setup and Build
148
+
149
+ 1. Clone the repository and install dependencies:
150
+ ```bash
151
+ git clone https://github.com/api-now/mcp.git
152
+ cd mcp
153
+ npm install
154
+ ```
155
+ 2. Build the TypeScript source code:
156
+ ```bash
157
+ npm run build
158
+ ```
159
+ 3. Run the server in development mode:
160
+ ```bash
161
+ npm run dev
162
+ ```
163
+
164
+ ### Quality and Testing
165
+
166
+ - **Run typechecks**: `npm run typecheck`
167
+ - **Run tests**: `npm run test`
168
+ - **Format code**: `npm run format`
169
+
170
+ ---
171
+
172
+ ## License
173
+
174
+ Distributed under the MIT License. See [LICENSE.md](LICENSE.md) for more details.