FormKiQ Document MCP Server
OfficialFormKiQ MCP Server
MCP server for FormKiQ, exposing the FormKiQ OpenAPI spec and selected FormKiQ API operations as Model Context Protocol tools.
This server:
exposes the FormKiQ JWT OpenAPI spec as an MCP resource at
openapi://formkiq/jwtparses operation metadata from the OpenAPI document
proxies a curated set of FormKiQ operations as MCP tools
forwards calls to a deployed FormKiQ API using a JWT
defaults to read-only access, with separate opt-in write and purge tools
validates arguments and streams responses within a configurable size limit
Each MCP server release bundles an OpenAPI snapshot for offline startup. Its upstream source and checksum are recorded in provenance.json. The MCP server version and the upstream FormKiQ API version are independent.
Quick Start
For release installations, let your MCP client start this server with pipx from a GitHub release tag, using @vMAJOR.MINOR.PATCH.
These GitHub installation examples use the published MCP server release v0.2.0. Version 0.2.1 in pyproject.toml is being prepared for publication. For local development, use the checkout-based Install and Local Codex Development Setup instructions. Published releases are listed in Releases.
Use the FormKiQ CloudFormation HttpApiUrl output for JWT/Cognito authentication:
aws cloudformation describe-stacks \
--stack-name "<formkiq-stack-name>" \
--query "Stacks[0].Outputs[?OutputKey=='HttpApiUrl'].OutputValue | [0]" \
--output textReplace the example endpoint and JWT values below. Keep the same release tag across client configurations. The tag selects the application version; the checked-in uv.lock pins dependencies for checkout-based installations.
Codex Setup
Add this to ~/.codex/config.toml or to a trusted project's .codex/config.toml:
[mcp_servers.formkiq]
command = "pipx"
args = ["run", "--spec", "git+https://github.com/formkiq/formkiq-mcp-server.git@v0.2.0", "formkiq-mcp-server"]
env = { "MCP_TRANSPORT" = "stdio", "FORMKIQ_API_ENDPOINT_URL" = "https://abc123.execute-api.us-east-1.amazonaws.com", "FORMKIQ_JWT" = "eyJ..." }
startup_timeout_sec = 30
tool_timeout_sec = 60
enabled = trueStart a new Codex session and check:
/mcpClaude Code Setup
Add the server from the CLI:
claude mcp add --transport stdio formkiq \
--env FORMKIQ_API_ENDPOINT_URL=https://abc123.execute-api.us-east-1.amazonaws.com \
--env FORMKIQ_JWT=eyJ... \
--env MCP_TRANSPORT=stdio \
-- pipx run --spec "git+https://github.com/formkiq/formkiq-mcp-server.git@v0.2.0" formkiq-mcp-serverThen check:
claude mcp listInside Claude Code, use:
/mcpRelated MCP server: DocImprint Document Intelligence
PyPI and the official MCP Registry
Release 0.2.1 is prepared for PyPI and the official MCP Registry. The PyPI commands below apply after that release has been published; until then, use the GitHub installation above.
uvx --from formkiq-mcp-server==0.2.1 formkiq-mcp-serverFor a client that starts the server over stdio, use command uvx, arguments ["--from", "formkiq-mcp-server==0.2.1", "formkiq-mcp-server"], and the same environment configuration shown above. Keep MCP_TRANSPORT=stdio, provide your deployment's HTTPS JWT endpoint and a current access token, and begin with the default read-only access. This package does not provision a shared public MCP endpoint.
server.json contains the official-registry metadata and marks the access token as a secret configuration value. Its name must match the mcp-name marker in the PyPI README. Do not add real endpoints, JWTs, caller tokens, or customer data to the manifest.
The Publish Python package and MCP Registry workflow publishes only from the tag matching the package and registry versions. Before the first publication, a PyPI owner must configure a trusted publisher for project formkiq-mcp-server, GitHub owner formkiq, repository formkiq-mcp-server, workflow publish.yml, and environment pypi. This publisher setup grants package-upload authority to that workflow and requires the account owner's approval. Publish the matching GitHub release only after CI passes.
After PyPI confirms the version is available, publish server.json using an identity authorized for io.github.formkiq/. Organization namespaces currently require GitHub Actions OIDC (mcp-publisher login github-oidc) or an organization Owner's token with organization-membership read access. Interactive device login cannot currently verify organization ownership. Follow the official authentication guide and GitHub Actions publishing guide; the release workflow uses the supported OIDC route after PyPI publication. Its registry job runs in the mcp-registry environment, verifies the pinned publisher with Sigstore, and checks that the PyPI README contains the ownership marker before publishing. Configure any required environment approval rules before releasing.
For a manual retry from an authorized environment, run mcp-publisher publish from the directory containing server.json. Prefer OIDC in the reviewed release workflow over creating a long-lived token.
The manifest is preparation for publication; a GitHub release alone does not create a PyPI package or an official-registry listing. Verify both listings after publishing.
Requirements
Python 3.11+
Git for cloning the repository
pipxfor GitHub-backed MCP client setup, oruvfor local developmenta deployed FormKiQ API endpoint URL from the FormKiQ CloudFormation outputs
a FormKiQ JWT for API calls
Install uv
macOS — with Homebrew:
brew install uvWindows — in PowerShell, with WinGet:
winget install --id=astral-sh.uv -eLinux — with the official standalone installer:
curl -LsSf https://astral.sh/uv/install.sh | shOpen a new terminal after installation so PATH changes take effect, then verify:
uv --versionIf uv is still not found, follow the installer's PATH instructions. See the official uv installation guide for alternatives, including the Windows standalone installer and the macOS installer without Homebrew.
Optional: Install pipx
The local checkout workflow below uses uv. If you use the release-based MCP client examples, install pipx after uv on any of these operating systems:
uv tool install pipx
pipx --versionSee uv's tool installation guide if the pipx executable needs to be added to PATH.
Install
Run these commands in Terminal on macOS/Linux or PowerShell on Windows:
git clone https://github.com/formkiq/formkiq-mcp-server.git
cd formkiq-mcp-server
uv sync --lockedYou can also run release v0.2.0 directly from GitHub with pipx:
pipx run --spec "git+https://github.com/formkiq/formkiq-mcp-server.git@v0.2.0" formkiq-mcp-serverConfigure
Set the FormKiQ API endpoint and a current Cognito AccessToken from the same deployment. Set FORMKIQ_JWT to the token text; the server adds the Bearer prefix. Restart the server after changing the token. For JWT authentication, FORMKIQ_API_ENDPOINT_URL should be the HttpApiUrl value from the FormKiQ CloudFormation stack outputs.
For local development, copy the provided template without overwriting an existing file.
macOS/Linux:
cp -n .env.example .envWindows PowerShell:
if (!(Test-Path .env)) { Copy-Item .env.example .env }Edit .env with your deployment values:
FORMKIQ_API_ENDPOINT_URL=https://abc123.execute-api.us-east-1.amazonaws.com
FORMKIQ_JWT=your-raw-Cognito-AccessToken
MCP_TRANSPORT=streamable-http
FORMKIQ_API_GROUPS=coreThen start the server normally:
uv run --locked python server.pyBoth python server.py and the installed formkiq-mcp-server entry point automatically load .env from the current working directory at startup. The server does not search parent directories. Existing environment variables, including empty values, take precedence over the file. If you previously exported an endpoint or JWT and want to use the file instead, clear those exports first:
unset FORMKIQ_API_ENDPOINT_URL FORMKIQ_API_BASE_URL FORMKIQ_JWTIn Windows PowerShell:
Remove-Item Env:FORMKIQ_API_ENDPOINT_URL, Env:FORMKIQ_API_BASE_URL, Env:FORMKIQ_JWT -ErrorAction SilentlyContinueThe template includes API Groups, module declarations, transport, and write/purge flags. File values are literal; ${VAR} interpolation is disabled. .env and .env.* files are ignored by Git, with .env.example included as the shareable template. Restart after editing the file; JWT refresh is still manual.
If your MCP client launches the server from a different directory, configure its working directory or use an explicit file path with uv:
uv run --locked --env-file /absolute/path/to/.env python server.pyuv reads the explicitly selected file before starting Python. Operators can set PYTHON_DOTENV_DISABLED=1 to disable the server's automatic .env loading. No file is required when configuration is supplied by the host or MCP client.
Alternatively, export settings directly:
export FORMKIQ_API_ENDPOINT_URL="https://abc123.execute-api.us-east-1.amazonaws.com"
export FORMKIQ_JWT="<raw-Cognito-AccessToken>"Windows PowerShell equivalent:
$env:FORMKIQ_API_ENDPOINT_URL = "https://abc123.execute-api.us-east-1.amazonaws.com"
$env:FORMKIQ_JWT = "<raw-Cognito-AccessToken>"FormKiQ exposes different API endpoint outputs for different authentication modes:
Authentication mode | CloudFormation output | OpenAPI spec |
JWT / Cognito |
|
|
IAM |
|
|
API Key |
|
|
This MCP server currently sends bearer JWTs through FORMKIQ_JWT. The neutral FORMKIQ_API_ENDPOINT_URL name is used so IAM and API key support can be added without renaming the endpoint variable again.
You can retrieve the JWT endpoint, HttpApiUrl, with the AWS CLI:
aws cloudformation describe-stacks \
--stack-name "<formkiq-stack-name>" \
--query "Stacks[0].Outputs[?OutputKey=='HttpApiUrl'].OutputValue | [0]" \
--output textThen export it directly:
export FORMKIQ_API_ENDPOINT_URL="$(aws cloudformation describe-stacks \
--stack-name "<formkiq-stack-name>" \
--query "Stacks[0].Outputs[?OutputKey=='HttpApiUrl'].OutputValue | [0]" \
--output text)"Changing the endpoint or OpenAPI document alone does not enable IAM signing or API-key authentication. This implementation supports JWT authentication only.
FORMKIQ_API_BASE_URL is still accepted as a deprecated alias for compatibility, but new configs should use FORMKIQ_API_ENDPOINT_URL.
Optional: override the bundled OpenAPI document with a compatible local file:
export FORMKIQ_OPENAPI_FILE="/path/to/formkiq-core/docs/openapi/openapi-jwt.yaml"Optional: override the bundled document with an HTTPS URL (pin the URL to an immutable version). Set only one OpenAPI override:
export FORMKIQ_OPENAPI_URL="https://example.com/openapi-jwt.yaml"Run Locally Over HTTP
uv run --locked python server.pyOr, after installing/running through pipx:
pipx run --spec "git+https://github.com/formkiq/formkiq-mcp-server.git@v0.2.0" formkiq-mcp-serverBy default, the Python MCP SDK serves Streamable HTTP at:
http://localhost:8000/mcpUse this mode for MCP clients that connect to an already-running HTTP server.
Run Over Stdio
Most local AI clients start MCP servers as child processes over stdio. This server supports that mode with:
MCP_TRANSPORT=stdio uv run --locked python server.pyYou normally do not run that command manually. Instead, put it in your MCP client configuration.
Tools
Every enabled endpoint has a dedicated MCP tool generated from the pinned OpenAPI spec. Each tool exposes its path/query/header parameters and JSON request body schema, including required fields, types, enums, and referenced definitions. Tool names follow the operation ID in snake case (for example, GetDocumentOcr becomes get_document_ocr); DocumentSearch retains the established name search_documents.
The default core configuration exposes 29 tools: 25 endpoint tools plus four supporting tools:
list_formkiq_operationslists enabled endpoints, API groups, permissions, andtoolName.describe_operationprovides focused schemas and examples for an operation ID.call_formkiq_operationretains the generic read/search interface.count_documentsadds explicit count truncation/exactness information.
API Groups, installed modules, write/purge flags, and the current caller's operation allowlist filter both endpoint discovery and invocation. With all groups and required modules, read-only access exposes 40 endpoint tools plus the four supporting tools. Enabling writes and purge exposes up to 69 endpoint tools, with an additional generic write tool. The table below maps all supported endpoints to their tools.
Dedicated tools accept API parameter names directly. For example, call get_document with:
{"documentId":"abc-123","siteId":"default"}Or call get_folder_documents with:
{"path":"invoices/2026","siteId":"default","limit":"10"}JSON request bodies go in body, for example add_document_tags (with writes enabled):
{"documentId":"abc-123","siteId":"default","body":{"tags":[{"key":"type","value":"invoice"}]}}Parameters keep the API's types (limit is usually a string). If a custom spec uses the same parameter name in multiple locations, tools expose location-prefixed names such as path_id and query_id; an API parameter named body also receives a location prefix. Unexpected fields are rejected before any backend request.
Supported FormKiQ API Endpoints
Method | Path | Operation ID | Tool | API group | Access |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The explicit operation registry is in formkiq_mcp/operations.py; access is assigned by effect, not HTTP verb or name. GetDocumentIdUpload is a write because it grants upload capability, while IndexSearch is a read despite using POST. requiredPermission is preserved from the upstream spec for guidance; FormKiQ remains the authority for permissions.
Startup rejects specs with missing catalog operations, duplicate operation IDs, or unresolved/external references. Custom documents must include all 69 supported operations, use OpenAPI 3.0, and use JSON request bodies.
API Groups and Installed Modules
The default API group is core, which is always included. Additional API groups are opt-in:
API group | Operations | Deployment capability |
| Document and attribute operations, folders/index search, site discovery, site schemas/classifications | Common API endpoints; backend permissions still apply |
|
| Tesseract is available without an add-on; Textract-specific options require |
|
|
|
|
|
|
|
|
|
| Workflow/queue inspection, starting document workflows, submitting decisions |
|
|
| Explicit API group opt-in; backend |
export FORMKIQ_API_GROUPS="core,ocr,fulltext,ai,malware,workflows"Leaving FORMKIQ_API_GROUPS unset or empty selects only core.
Installed modules are discovered automatically at startup. When an endpoint and JWT are configured, the server makes one read-only GetVersion request, with a five-second overall timeout, before serving the first tool list. You do not need to call get_version manually to expose module-backed tools. Only selected API Groups are exposed, and write/purge flags and caller grants still apply.
For hosted HTTP, startup discovery uses the first configured caller whose operation allowlist includes GetVersion, with that caller's downstream JWT. If no caller grants GetVersion, discovery is skipped; it does not fall back to the global JWT to bypass caller policies. Allow GetVersion for a discovery caller, or declare installed capabilities with FORMKIQ_MODULES.
Discovery failures do not prevent startup. Missing credentials, authorization failures, unreachable endpoints, and invalid module responses are reported on stderr. Selected groups with missing capabilities are also named, with a reminder to declare installed but unadvertised modules. Explicit FORMKIQ_MODULES declarations remain effective even if discovery fails. Unknown module names are ignored.
For stdio clients, pass optional settings through the client's environment table or allowlist, or use .env, then restart the child server. To disable startup discovery for offline use or fully explicit configuration:
FORMKIQ_AUTO_DISCOVER=falseYou can still call get_version to retry failed discovery or refresh capabilities after the backend changes. Then refresh the client's tool list (MCP tools/list); clients that cache tools may need a manual refresh, as the server does not send tool-list change notifications. Automatic discovery runs once per server lifespan, rather than on every request.
Some deployments do not advertise every feature in GetVersion.modules. Declare those installed capabilities explicitly:
export FORMKIQ_MODULES="workflows"Supported capability names include opensearch, typesense, textract, ai, malware, and workflows. Versioned identifiers such as opensearch_2.19.2 are recognized. Explicit declarations supplement discovered modules; they do not install features or grant permissions. Read-only configuration remains the default even when all optional API groups are selected. DocumentSearch remains in core; its structured and JSON predicates do not require OpenSearch.
Administration, integrations, deprecated processing APIs, and public/provider callback endpoints are outside this version's catalog.
Search, Counts, and Explicit Deletion
search_documents accepts body, siteId, next, previous, limit (a string, as defined by the API), and projection (DOCUMENTS or COUNT). Use describe_operation("DocumentSearch") for multi-attribute and nested JSON examples. Continue document pagination while next is present, even if a filtered page contains no matches.
Example count_documents arguments:
{"body":{"query":{"attribute":{"key":"invoiceDetails","json":{"path":"$.total","gte":1000}}}},"siteId":"default"}The count helper uses the existing DocumentSearch endpoint with projection=COUNT. It preserves body.count and body.truncated and adds countIsExact. A truncated count is a lower bound, capped at 10,000 or stopped by the backend processing budget. COUNT has no continuation tokens, and the helper never aggregates partial counts. Invalid or older backend responses are reported as errors rather than treated as exact totals.
When writes are enabled, delete_document requires an explicit deleteType: SOFT_DELETE, HARD_DELETE, or CONTENT_ONLY. The generic write tool also requires deleteType for DeleteDocument, or an explicit legacy softDelete boolean. CONTENT_ONLY preserves metadata and historical S3 versions; permanent historical removal still uses the separately enabled purge tool.
The dedicated get_folder_documents tool accepts a folder path directly as path. For generic calls, folder paths use args.query.path; args.path is reserved for URL path parameters. Upload/download acceleration remains available as the accelerate parameter on URL operations.
Generic Tool Shape
call_formkiq_operation accepts nested arguments or unambiguous top-level parameter names. Unknown/conflicting arguments, missing required values, invalid types, and path dot segments are rejected before sending requests. Request bodies follow the schema returned by describe_operation; unknown body fields follow that schema’s additionalProperties rule.
Nested example:
{
"operation_id": "GetDocument",
"args": {
"path": {
"documentId": "abc-123"
},
"query": {
"siteId": "default"
}
}
}For request bodies:
{
"operation_id": "DocumentSearch",
"args": {
"query": {
"siteId": "default"
},
"body": {
"query": {
"text": "invoice"
}
}
}
}Local Codex Development Setup
For local development from a checkout, use uv in ~/.codex/config.toml or in a trusted project's .codex/config.toml:
[mcp_servers.formkiq]
command = "uv"
args = ["run", "--locked", "python", "server.py"]
cwd = "/Users/you/Documents/github/formkiq-mcp-server"
env_vars = ["FORMKIQ_API_ENDPOINT_URL", "FORMKIQ_JWT", "FORMKIQ_API_GROUPS", "FORMKIQ_MODULES", "FORMKIQ_AUTO_DISCOVER", "FORMKIQ_ENABLE_WRITES", "FORMKIQ_ENABLE_PURGE"]
startup_timeout_sec = 30
tool_timeout_sec = 60
enabled = true
[mcp_servers.formkiq.env]
MCP_TRANSPORT = "stdio"If you want to pin the spec to a local checkout, add:
FORMKIQ_OPENAPI_FILE = "/Users/you/Documents/github/formkiq-core/docs/openapi/openapi-jwt.yaml"Then start a new Codex session and check:
/mcpYou can also verify from a shell:
codex mcp listCodex MCP configuration reference: https://developers.openai.com/codex/mcp
Claude Code Project Setup
For a project-shared Claude Code setup from a local checkout, add a .mcp.json file to your project:
{
"mcpServers": {
"formkiq": {
"type": "stdio",
"command": "uv",
"args": ["--directory", "/Users/you/Documents/github/formkiq-mcp-server", "run", "--locked", "python", "server.py"],
"env": {
"MCP_TRANSPORT": "stdio",
"FORMKIQ_API_ENDPOINT_URL": "https://abc123.execute-api.us-east-1.amazonaws.com",
"FORMKIQ_JWT": "eyJ..."
}
}
}
}Then run:
claude mcp listInside Claude Code, use:
/mcpClaude Code MCP docs: https://docs.anthropic.com/en/docs/claude-code/mcp
Claude Desktop Setup
Claude Desktop uses claude_desktop_config.json.
Config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Example:
{
"mcpServers": {
"formkiq": {
"command": "uv",
"args": ["--directory", "/Users/you/Documents/github/formkiq-mcp-server", "run", "--locked", "python", "server.py"],
"env": {
"MCP_TRANSPORT": "stdio",
"FORMKIQ_API_ENDPOINT_URL": "https://abc123.execute-api.us-east-1.amazonaws.com",
"FORMKIQ_JWT": "eyJ..."
}
}
}
}Restart Claude Desktop after editing the config. If the MCP server does not appear, check Claude Desktop's MCP logs:
macOS:
~/Library/Logs/ClaudeWindows:
%APPDATA%\Claude\logs
Claude Desktop local MCP setup docs: https://modelcontextprotocol.io/docs/develop/connect-local-servers
MCP Inspector
Run the HTTP server:
uv run --locked python server.pyThen start the inspector:
npx -y @modelcontextprotocol/inspectorConnect to:
http://localhost:8000/mcpWrite and Purge Access
Read-only access is the default. To expose dedicated write tools such as add_document, add_document_tags, and delete_document, along with call_formkiq_write_operation:
export FORMKIQ_ENABLE_WRITES=trueRead tools continue to reject mutations. Permanent purge is enabled separately and exposes purge_document:
export FORMKIQ_ENABLE_WRITES=true
export FORMKIQ_ENABLE_PURGE=trueRestart the server after changing configuration. MCP clients should request user approval for destructive actions; tool annotations identify reads and mutations. Server-side flags and caller policies enforce access independently of client annotations.
Migration from v0.1.0: endpoints now have dedicated tools with full OpenAPI input schemas. Existing get_version, get_documents, get_document, and search_documents names remain available; generic tools also remain supported. SearchFulltext requires the fulltext API group and an OpenSearch capability; GetResourceActivities requires the audit API group. Document deletion requires an explicit mode. Custom OpenAPI files must cover 69 operations. Mutations use their dedicated tools or the generic write tool, and purge continues to require both flags and purge_document. HTTP tool listings are filtered to each caller's grants.
Response Handling and Limits
Responses retain operationId, method, statusCode, ok, and body. Full request URLs are omitted to avoid exposing share keys. Upstream API failures produce MCP isError: true, preserving the HTTP status, bounded response body, and Retry-After when present. Invalid JSON, unsupported binary content, transport failures, and timeouts also produce tool errors. A read operation with a declared download redirect returns a validated body.contentUrl without following the redirect or forwarding the FormKiQ JWT. Accepted processing responses preserve the backend status and body; they are not polled automatically. Issuing an upload URL does not complete the upload, and an accepted OCR/job request does not imply completion. Writes are never retried automatically.
FORMKIQ_MAX_RESPONSE_BYTES defaults to 65536 (64 KiB), with a supported range of 1 KiB–10 MiB. The proxy stops reading oversized decoded responses, closes the stream, and returns an explicit error. It also limits serialized tool payloads and operation descriptions. Request fewer results, follow pagination tokens, or use GetDocumentUrl for large content. The explicitly requested full OpenAPI resource is exempt from this limit; use describe_operation for focused schemas.
HTTP Caller Authentication
Local HTTP binds to 127.0.0.1:8000 by default. FORMKIQ_MCP_HOST and FORMKIQ_MCP_PORT configure the listener. Non-loopback HTTP refuses to start without FORMKIQ_MCP_AUTH_FILE. A reverse proxy that exposes a loopback listener publicly must also use caller authentication.
HTTP authentication uses preconfigured MCP bearer tokens. Configure the token manually in the MCP client; this mode does not provide an OAuth authorization server or automatic OAuth login. MCP tokens are distinct from downstream FormKiQ JWTs and are never forwarded to FormKiQ.
Generate a high-entropy token and its SHA-256 hash:
python3 - <<'PYTOKEN'
import hashlib
import secrets
token = secrets.token_urlsafe(32)
print("MCP client token:", token)
print("token_sha256:", hashlib.sha256(token.encode()).hexdigest())
PYTOKENStore only the hash in a private policy file:
{
"clients": [
{
"id": "analyst",
"token_sha256": "<64-character-lowercase-sha256>",
"jwt_env": "FORMKIQ_ANALYST_JWT",
"allowed_operations": ["GetVersion", "GetSites", "GetDocuments", "GetDocument", "DocumentSearch"],
"allowed_sites": ["tenant-a"]
}
]
}export FORMKIQ_MCP_AUTH_FILE="/private/path/formkiq-callers.json"
export FORMKIQ_ANALYST_JWT="<FormKiQ JWT scoped to this caller>"
export FORMKIQ_MCP_HOST="0.0.0.0"
uv run --locked python server.pyEach request requires Authorization: Bearer <MCP client token>. Policies restrict operation IDs and site IDs in both path and query parameters, and each caller maps to its own downstream JWT variable. For HTTP callers, GetSites returns only allowed site summaries (siteId, title, status, roles, permissions), excluding global claims and site configuration. Explicit indexName overrides are disabled for HTTP callers to preserve site isolation. Missing siteId means default, which must be explicitly authorized; a tenant-specific caller should supply its site. Global write/purge flags remain required even if a caller policy lists those operations. Policy files load at startup; restart to rotate tokens or policies. Use least-privilege downstream JWTs and replace them when they expire.
HTTP uses stateless MCP requests so caller identity remains attached to each request. A single async HTTP client is reused for the application lifespan. Requests have a 10-second connect timeout and 30-second network-operation timeout.
Security and Hosting
Use the CloudFormation
HttpApiUrlendpoint for JWT authentication. IAM signing and API-key authentication are not implemented.FormKiQ endpoints require HTTPS, except loopback HTTP for local development.
Do not commit JWTs, MCP bearer tokens, or private caller-policy files. Prefer environment variables and secret management.
Operation audit records go to stderr and include caller ID, operation ID, outcome, status, and duration. Bodies, document IDs, query parameters, and credentials are excluded.
Place hosted HTTP behind TLS and configure caller authentication, authorization, and infrastructure rate limits. Use a long-running ASGI-compatible host such as ECS or App Runner. Lambda/API Gateway deployments require an appropriate ASGI adapter and timeout configuration.
Development and Verification
uv sync --locked
uv run --locked ruff check .
uv run --locked ruff format --check .
uv run --locked python -m unittest discover -v
uv buildTests validate all 69 generated endpoint schemas and route all 29 added endpoints through their dedicated tools. They cover .env startup and environment precedence, automatic module discovery before the initial tool list, discovery failures/timeouts/cancellation, explicit operation effects, caller-specific tool discovery and cached-tool authorization, API group/module gating and revocation, path/query/header/body routing, recursive schemas, site isolation, filtered site discovery, nested JSON search, count truncation, deletion modes, download redirects, async acceptance, response limits, concurrency, HTTP transport, and stdio startup. Backend requests are mocked. CI runs the locked environment on Python 3.11 and 3.14, then installs the wheel in an isolated environment and checks the console entry point, generated tool schemas, and bundled resource.
When updating the bundled spec, use an immutable upstream commit, update formkiq_mcp/data/provenance.json with the source and SHA-256, and run the suite. Keep the upstream Apache-2.0 license attribution in that file.
Release tags use vMAJOR.MINOR.PATCH and match [project].version in pyproject.toml (for example, package version 0.1.0 uses tag v0.1.0). Before publishing a release, update the package version, regenerate uv.lock, update the installation examples to the matching tag, and run the verification steps above. Keep published release tags fixed to their original commits.
Available Tools
29 toolscall_formkiq_operationBRead-onlyIdempotent
Call a read/search operation. Use describe_operation first. Args accepts path, query, headers, body, or unambiguous top-level parameter names.
Inputs: operation_id (required), args. Returns: object
count_documentsARead-onlyIdempotent
Count matching documents using DocumentSearch. Counts stop at 10,000 or a processing budget. countIsExact=false means the count is a lower bound; do not interpret it as the total or aggregate partial counts.
Inputs: body (required), siteId. Returns: object
describe_operationBRead-onlyIdempotent
Get an enabled operation's parameters, JSON request schema, examples, and reachable local definitions.
Inputs: operation_id (required). Returns: object
get_attributeCRead-onlyIdempotent
Get Attribute
Returns a attribute
FormKiQ operation: GetAttribute. API group: core. Access: read.
Inputs: key (required), siteId.
get_attribute_allowed_valuesBRead-onlyIdempotent
Get Attribute Allowed Values
Returns an attribute's allowed values that spans across all classifications and site schema
FormKiQ operation: GetAttributeAllowedValues. API group: core. Access: read.
Inputs: key (required), siteId.
get_attributesCRead-onlyIdempotent
Get Attributes listing
Returns a list of attributes
FormKiQ operation: GetAttributes. API group: core. Access: read.
Inputs: next, limit, siteId.
get_classificationCRead-onlyIdempotent
Get Classification
Get Classification
FormKiQ operation: GetClassification. API group: core. Access: read.
Inputs: siteId (required), classificationId (required), locale.
get_classification_attribute_allowed_valuesBRead-onlyIdempotent
Get Classification's Attribute Allowed Values
Returns an attribute's allowed values that spans for a specific classifications and site schema
FormKiQ operation: GetClassificationAttributeAllowedValues. API group: core. Access: read.
Inputs: key (required), siteId (required), classificationId (required), locale.
get_documentBRead-onlyIdempotent
Get document
Retrieves a document's details, i.e., metadata
FormKiQ operation: GetDocument. API group: core. Access: read.
Inputs: documentId (required), siteId, shareKey, artifactId.
get_document_actionsCRead-onlyIdempotent
Get document actions
Get document actions and their status
FormKiQ operation: GetDocumentActions. API group: core. Access: read.
Inputs: documentId (required), next, limit, siteId, +2 more.
get_document_artifactsCRead-onlyIdempotent
Get document artifacts
Returns the list of artifact documents associated with the specified document
FormKiQ operation: GetDocumentArtifacts. API group: core. Access: read.
Inputs: documentId (required), next, limit, siteId.
get_document_attributeBRead-onlyIdempotent
Get document attribute by key
Get a document attribute by using its key
Requires READ_DOCUMENT_ATTRIBUTES or READ. ADMIN retains access.
FormKiQ operation: GetDocumentAttribute. API group: core. Access: read.
Inputs: documentId (required), attributeKey (required), siteId, artifactId.
get_document_attributesCRead-onlyIdempotent
Get document's attributes
Get a listing of a document's attributes
Requires READ_DOCUMENT_ATTRIBUTES or READ. ADMIN retains access.
FormKiQ operation: GetDocumentAttributes. API group: core. Access: read.
Inputs: documentId (required), next, limit, siteId, +1 more.
get_document_contentARead-onlyIdempotent
Get document's contents
Retrieves the content of the document with the specified documentId.
If the content is plain text and under 6 MB, the content will be returned directly.
If the content is plain text but exceeds 6 MB, an error will be returned.
For documents not in plain text format, pre-signed S3 URLs will be returned to download the content from S3. It is recommended to use the
/documents/{documentId}/urlendpoint to retrieve pre-signed S3 URLs for downloading the content.
If the document has a Content-Type of text/, application/json, application/x-www-form-urlencoded the content field will be returned. All other Content-Type, the contentUrl field will be returned, which is a S3 Presigned url.
FormKiQ operation: GetDocumentContent. API group: core. Access: read.
Inputs: documentId (required), siteId, shareKey, accelerate, +2 more.
get_documentsBRead-onlyIdempotent
Get Documents listing
Returns a list of the most recent documents added, ordered by inserted, descending
FormKiQ operation: GetDocuments. API group: core. Access: read.
Inputs: tz, end, date, next, +10 more.
get_document_tagCRead-onlyIdempotent
Get document tag by key
Get a document tag by using its key
FormKiQ operation: GetDocumentTag. API group: core. Access: read.
Inputs: tagKey (required), documentId (required), siteId, shareKey, +1 more.
get_document_tagsCRead-onlyIdempotent
Get document's tags
Get a listing of a document's tags
FormKiQ operation: GetDocumentTags. API group: core. Access: read.
Inputs: documentId (required), next, limit, siteId, +3 more.
get_document_urlARead-onlyIdempotent
Get document content url
Returns a URL for the document's contents. Direct S3 presigned URLs expire after 48 hours by default.
With the Shortlinks Add-On Module, use format=short&maxUses=1 for a single-redemption short link,
or set maxUses to a larger positive integer to allow that many redemptions. Omitting maxUses
permits unlimited redemptions during the short link's validity period.
For usage-limited short links, duration controls the short link's validity in hours.
Each successful redemption generates a fresh S3 presigned URL valid for 20 seconds.
The S3 request must start before expiry; a download already in progress can continue afterward.
The S3 URL itself can be reused during those 20 seconds.
FormKiQ operation: GetDocumentUrl. API group: core. Access: read.
Inputs: documentId (required), format, inline, siteId, +7 more.
get_document_versionsBRead-onlyIdempotent
Get document's versions
Get a listing of document content and metadata versions; available as an Add-On Module
FormKiQ operation: GetDocumentVersions. API group: core. Access: read.
Inputs: documentId (required), next, limit, siteId, +2 more.
get_folder_documentsCRead-onlyIdempotent
Get document folders
Get list of documents in a folder
FormKiQ operation: GetFolderDocuments. API group: core. Access: read.
Inputs: next, path, limit, siteId, +2 more.
get_permission_catalogARead-onlyIdempotent
Get API permission catalog
Returns the supported API permission role types, grouped by permission group, with the scoped permission names and descriptions in each group. Use this catalog when creating API keys or mapping user roles to permissions.
Predefined role types contain their effective permissions, including permissions inherited from other operation categories. CUSTOM contains all available scoped permissions as selectable options; it does not automatically grant them. Deprecated umbrella permissions are excluded from the permission lists, and empty groups are omitted.
The catalog is available to authenticated callers without a site-specific API permission. It describes supported grants rather than the caller's current permissions or authority to assign those grants. No siteId is required.
FormKiQ operation: GetPermissionCatalog. API group: core. Access: read.
Inputs: no named parameters.
get_sitesARead-onlyIdempotent
Get site(s) access
Returns the list of sites that the user has access to
FormKiQ operation: GetSites. API group: core. Access: read.
Inputs: status.
get_sites_classificationsCRead-onlyIdempotent
Get Sites Classifications
Gets Sites Classifications
FormKiQ operation: GetSitesClassifications. API group: core. Access: read.
Inputs: siteId (required), next, limit.
get_sites_schemaCRead-onlyIdempotent
Get Sites Schema
Gets Sites schema
FormKiQ operation: GetSitesSchema. API group: core. Access: read.
Inputs: siteId (required), locale.
get_sites_schema_attribute_allowed_valuesBRead-onlyIdempotent
Get Attribute Allowed Values
Returns an attribute's allowed values from the site schema
FormKiQ operation: GetSitesSchemaAttributeAllowedValues. API group: core. Access: read.
Inputs: key (required), siteId (required), locale.
get_versionARead-onlyIdempotent
Get FormKiQ version
Return the version of FormKiQ
FormKiQ operation: GetVersion. API group: core. Access: read.
Inputs: no named parameters.
index_searchARead-onlyIdempotent
Perform a search on a index; this is currently available for both folder and tag indices
FormKiQ operation: IndexSearch. API group: core. Access: read.
Inputs: body (required), next, limit, siteId, +1 more.
list_formkiq_operationsARead-onlyIdempotent
List operations enabled for this caller. Writes and purge are disabled by default.
Inputs: no named parameters. Returns: result
search_documentsARead-onlyIdempotent
Document search
Document search query request;
Supports searching DynamoDB for document(s) by a single TAG key and/or value. Value can be "exacted" or "begins_with" matched. Search can be filtered to only check certain documentIds (up to 100 documentIds accepted).
If using Enteprise Composite Keys feature then multiple tag(s) can be searched for.
For attributes defined with dataType JSON, use an attribute criterion's json filter with a path to compare a nested field. The eq and eqOr operators accept strings, including inside json filters. Match JSON boolean fields using the strings "true" or "false". Compare JSON numeric fields using gt, gte, lt, and lte. Paths support object properties and explicit array positions; wildcard, recursive, and array any-element matching are not supported. Multiple conditions on different paths under the same attribute key are supported. All conditions must match the same document or artifact.
JSON path filtering is applied after candidate records are read and does not reduce read capacity consumed for those candidates. A stored JSON value does not automatically create an index for its nested fields. Continue through empty filtered pages until the next token is absent; candidate and time-budget limits still apply.
If Typesense is enabled, full text search is supported through the "text" parameter. Full text search will look for the text in the "content" and/or document "metadata".
When documentIds is supplied, all supplied IDs are checked against the search criteria and all matching documents are returned. The limit query parameter is ignored. Up to 100 document IDs are accepted.
Use the projection parameter to return matching documents or a count of matching documents. Count responses are capped at 10,000 and indicate when the count was truncated.
Multi-attribute searches requiring additional attribute filtering use a 25-second processing budget
for index batches, attribute filtering, and document loading. The budget starts after index selection and empty-index prechecks. Searches with explicit
documentIds or a composite key covering every search attribute are exempt.
The budget is checked before starting each read; an in-flight read is allowed to finish.
If the budget expires, document searches return completed matches with truncated=true and a next token;
count searches return a partial lower bound with truncated=true.
See requestBody examples below for commmon examples.
FormKiQ operation: DocumentSearch. API group: core. Access: read. Continue pagination while next is present, including after empty pages. COUNT can be truncated; count_documents reports exactness.
Inputs: body (required), next, limit, siteId, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
call_formkiq_operation is a generic dispatcher that can perform any of the ~24 read operations already exposed as dedicated tools, so an agent must guess whether to call get_document or the dispatcher with a path. count_documents also overlaps with search_documents using the COUNT projection, and the three attribute_allowed_values variants differ only by scope, relying on subtle description wording rather than distinct names.
The set is overwhelmingly snake_case verb_noun (get_document, get_document_tags, get_sites_schema), which is predictable and readable. Minor deviations exist: index_search reverses the order, and the meta-tools (call_formkiq_operation, describe_operation, list_formkiq_operations) use a different verb vocabulary.
29 tools exceeds a comfortable surface, and the count is inflated by a full per-operation enumeration that duplicates what the generic call_formkiq_operation dispatcher can already do. Each tool does map to a real FormKiQ API operation, but the wrapper-plus-dispatch duplication means several tools do not independently earn their place.
The read/search surface is broad and well covered (documents, content, versions, tags, attributes, classifications, schemas, sites, artifacts, permissions), but every exposed tool is Access: read — there is no create, upload, update, tag-set, or delete path, so any write workflow is a dead end. The description notes writes are disabled by default, implying the exposed surface is intentionally half the lifecycle.
Maintenance
Related MCP Connectors
Give AI agents access to form submissions — read, search, update, and process file attachments.
Hosted document tools for agents: extract, parse, classify, convert, OCR, sign, and redact.
Create documents and reusable templates, request signatures, and track approvals — for AI agents.
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Related MCP Servers
FlicenseAqualityDmaintenanceEnables AI agents to upload, verify, and chat about documents for compliance (e.g., SOC2, GDPR) with PII redacted server-side.8-- AlicenseAqualityDmaintenanceVerifiable document intelligence for AI agents. Extract text, tables, and structured data from PDFs and URLs. Summarize, answer questions, check claims, and translate — all with cited evidence. Store tamper-evident evidence bundles with cryptographic signatures and on-chain attestation via Base L2. Cross-document semantic search and Q&A across named collections. Pay per call with USDC2212 npm1MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents like Claude and Codex to store, search, and exchange project knowledge such as architectural decisions and work packets, with tenant isolation for security.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search, retrieve, and share files by meaning across connected storage, with permission-aware access control and an audit trail.1Apache 2.0