Skip to main content
Glama
openapi-mcp-sdk

openapi-mcp-sdk


build PyPI Python License MCP mcptry Linux Foundation Member

Overview

Welcome to openapi-mcp-sdk, this is the official openapi.com MCP SDK. It ships as a Python package on PyPI and can be used in two ways:

  • Ready-to-use server — run the MCP gateway directly from the package with a single command, no cloning or setup required.

  • Python library — import openapi_mcp_sdk in your own project to build a custom MCP server that wraps openapi.com APIs with your own logic, tools, or auth layer on top.

Environment variables

All configuration is done through environment variables. None are required to start the server — defaults are suitable for local use.

Core

Variable

Default

Description

MCP_PORT

8080

HTTP port the server listens on

MCP_ENV

production

Runtime environment: dev | staging | production

MCP_BASE_URL

http://localhost:8080

Public URL of this server (used to build callback and file download URLs)

MCP_CALLBACK_URL

$MCP_BASE_URL/callbacks

Explicit callback URL sent to async APIs

MCP_OPENAPI_ENV

(empty)

Openapi environment: dev, test, sandbox (alias of test), or empty for production

Storage

The server needs to store files for APIs that return binary documents (e.g. company official documents). The storage backend is configurable:

Variable

Default

Description

MCP_STORAGE_BACKEND

local

local | gcs | s3

MCP_STORAGE_PATH

./openapi_storage

Local path for local backend

MCP_STORAGE_BUCKET

(required for cloud)

Bucket name for gcs or s3

MCP_STORAGE_REGION

(required for s3)

AWS region for the S3 bucket

Cache

Used to share async callback results across multiple server instances.

Variable

Default

Description

MCP_CACHE_BACKEND

none

none (in-process dict) | memcached | redis

MCP_CACHE_URL

(none)

Redis connection URL (MCP_CACHE_BACKEND=redis), e.g. redis://host:6379

MCP_CACHE_HOST

(none)

Memcached host (MCP_CACHE_BACKEND=memcached)

MCP_CACHE_PORT

11211

Memcached port

See docs/env/ for per-environment configuration guides (local, Docker, AWS, GCP, Kubernetes).

Related MCP server: swaggbot

Features

  • Secure proxy: Pass-through of the Bearer Token provided by the client, without direct handling of sensitive credentials.

  • Extensible: Easily add new tools/APIs by creating modules in /apis/.

  • MCP-compatible: Designed according to MCP protocol best practices.

  • Modular: All API call logic and tool registration is centralized in mcp_core.py.

No cloning, no virtual environment. Start the server in one command:

uvx openapi-mcp-sdk server

The server starts immediately at http://localhost:8080.

Other runtimes

# pipx (ephemeral run, no install needed — similar to uvx)
pipx run openapi-mcp-sdk server

# pip (installs the package, then run the command)
pip install openapi-mcp-sdk && openapi-mcp-sdk server

# pip3 on systems where python3 is the default
pip3 install openapi-mcp-sdk && openapi-mcp-sdk server

CLI reference

openapi-mcp-sdk <command>

Commands:
  server   Start the MCP server (HTTP/SSE, default port 8080)
  ping     Ping the openapi.com APIs and report latency       [coming soon]
  token    Generate or inspect an openapi.com Bearer token    [coming soon]

Running with Docker

The project ships a single compose.yml with the mcp service.

# Build and start (production-like image)
docker compose up --build

# Run in background
docker compose up --build -d

# Follow logs
docker compose logs -f mcp

The server will be accessible at http://localhost:8080.

Debug and Development

Local development (without Docker)

The fastest iteration loop runs the server directly with uvicorn:

make start

This sets PYTHONPATH=src and starts uvicorn with auto-reload disabled. The server listens on http://0.0.0.0:8080.

To test endpoints manually:

curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:8080

The server prints request headers and parameters to stdout — no extra configuration needed.

Remote debugging with VS Code and Docker (one click)

The repository is pre-configured for a single-click debug experience. No manual steps, no editing compose files, no terminal commands.

How it works

File

Role

docker/dev/Dockerfile

Debug image — adds debugpy, exposes port 5678

compose.yml

Compose config — dev image, debug ports, bind mount

.vscode/tasks.json

VS Code tasks — starts/stops the container automatically

.vscode/launch.json

Launch config — ties everything together under F5

Workflow

  1. Set your breakpoints anywhere in src/.

  2. Open Run and Debug (Ctrl+Shift+D / ⌘+Shift+D).

  3. Select MCP: Debug (Docker) from the dropdown.

  4. Press F5.

VS Code will:

  • Build the debug image (docker/dev/Dockerfile) if needed.

  • Start the container via compose.yml (debug image + bind mount).

  • Wait automatically until debugpy is accepting connections on port 5678.

  • Attach debugpy — your breakpoints are now live.

When you press ⇧F5 (Stop), VS Code detaches and tears down the container.

Keep the container alive after detaching? Remove the "postDebugTask" line from .vscode/launch.json. You can then re-attach at any time by pressing F5 again without rebuilding.

Live code reload

compose.yml bind-mounts ./src into /app/src inside the container. Edits to files under src/ are reflected immediately — no image rebuild required. Just send a new request and the updated code runs.

Path mapping reference

Host

Container

Source code

./src

/app/src

MCP server

localhost:8080

0.0.0.0:8080

debugpy listener

localhost:5678

0.0.0.0:5678

Authentication

The server accepts the Bearer token in two ways:

Pass the token as a standard HTTP header:

Authorization: Bearer YOUR_TOKEN

Option B — ?token= query parameter

Some MCP clients or environments do not support custom HTTP headers. In that case the token can be embedded directly in the server URL as a query parameter:

http://YOUR_SERVER_IP:8080/?token=YOUR_TOKEN

The server automatically promotes it to an Authorization: Bearer header before the request reaches the MCP layer, so the behaviour is identical.

When to use ?token=: Claude Desktop (as of mid-2025), some browser-based MCP playgrounds, and any client whose configuration only accepts a plain URL without a headers field.

MCP Client Configuration (VS Code)

  1. Generate a Bearer Token From the portal https://console.openapi.com/oauth, create a token with the required scopes.

  2. Create the .vscode/mcp.json file

    With header (recommended):

    {
      "servers": {
        "openapi.com": {
          "type": "http",
          "url": "http://YOUR_SERVER_IP:8080/",
          "headers": {
            "Authorization": "Bearer YOUR_TOKEN"
          }
        }
      }
    }

    With ?token= query parameter (for clients that do not support custom headers):

    {
      "servers": {
        "openapi.com": {
          "type": "http",
          "url": "http://YOUR_SERVER_IP:8080/?token=YOUR_TOKEN"
        }
      }
    }
  3. Test the integration

    • Reload VS Code.

    • Open the Copilot chat and type @workspace.

    • Use the tools exposed by the MCP server.

File storage

Some openapi.com APIs (e.g. visure camerali — Italian official company documents) return large binary files (ZIP archives, PDFs) that cannot be embedded inline in the MCP stream. The server downloads these files, stores them, and serves them via a separate HTTP endpoint (GET /status/{id}/files/{filename}).

Default: local filesystem

By default (MCP_STORAGE_BACKEND=local) files are written to ./openapi_storage relative to the directory from which the server is started:

./openapi_storage/
└── <request_id>/
    ├── document.pdf
    └── attachments.zip

Override the path with the MCP_STORAGE_PATH environment variable:

export MCP_STORAGE_PATH=/var/data/openapi_storage
uvx openapi-mcp-sdk server

The directory is created automatically on first use. For the download links to work correctly, MCP_BASE_URL must point to the public address of the server (default: http://localhost:8080).

Cloud storage backends

MCP_STORAGE_BACKEND

Additional variables

Notes

local

MCP_STORAGE_PATH (default ./openapi_storage)

Default — local disk or mounted volume

gcs

MCP_STORAGE_BUCKET

Google Cloud Storage

s3

MCP_STORAGE_BUCKET, MCP_STORAGE_REGION

AWS S3 or any S3-compatible service

See docs/env/ for full per-environment configuration guides.

Deployment environments

Environment

Guide

Local machine (default)

docs/env/local.md

Docker / Docker Compose

docs/env/docker.md

Google Cloud Platform

docs/env/gcp.md

Amazon Web Services

docs/env/aws.md

Kubernetes

docs/env/kubernetes.md

Project Structure

Adding New Tools/APIs

  1. Create or modify a file in /apis/, following this pattern:

    from fastmcp import Context
    from typing import Any
    from mcp_core import make_api_call, mcp
    
    @mcp.tool
    async def tool_name(parameters..., ctx: Context) -> Any:
        # ...logic...
        return make_api_call(ctx, "GET", url, params=params)
  2. Restart the server to apply the changes.

Security Notes

  • Never hardcode credentials or tokens in the code.

  • The server expects the Bearer Token to be provided by the client via HTTP headers.

  • All API calls are proxied using the token provided by the client.

Useful Resources

Contributing

Contributions are always welcome! Whether you want to report bugs, suggest new features, improve documentation, or contribute code, your help is appreciated.

See docs/contributing.md for detailed instructions on how to get started. Please make sure to follow this project's docs/code-of-conduct.md to help maintain a welcoming and collaborative environment.

Authors

Meet the project authors:

Partners

Meet our partners using Openapi or contributing to this SDK:

License

This project is licensed under the MIT License.

The MIT License is a permissive open-source license that allows you to freely use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, provided that the original copyright notice and this permission notice are included in all copies or substantial portions of the software.

In short, you are free to use this SDK in your personal, academic, or commercial projects, with minimal restrictions. The project is provided "as-is", without any warranty of any kind, either expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement.

For more details, see the full license text at the MIT License page.

Available Tools

41 tools
check_async_statusCheck Async StatusBInspect

Show the last status of an async request Args: request_id: required, returned by an async downgraded request to the mcp server

Inputs: request_id (required).

check_email_advancedcheck_email_advancedC
Read-onlyIdempotent
Inspect

Retrieves advanced information about an email address (spfDetails, dmarcDetails, createdAt, updatedAt, state, message, success, valid, disposable, smtpScore, overallScore, firstName, generic, common, dnsValid, honeypot, deliverability, frequentComplainer, spamTrapScore, catchAll, timedOut, suspect, recentAbuse, fraudScore, suggestedDomain, leaked, sanitizedEmail, identityData, domainAge, firstSeen, riskyTld, spfRecord, dmarcRecord, mxRecords, aRecords) Args: email: the email to check

Inputs: email (required).

check_email_startcheck_email_startB
Read-onlyIdempotent
Inspect

Retrieves detailed information about an email address (spf, dmark, disposability, frauds) Args: email: the email to check

Inputs: email (required).

check_ip_advancedcheck_ip_advancedB
Read-onlyIdempotent
Inspect

Retrieves advanced information about an ip address (ip, createdAt, updatedAt, state, requestedIp, message, success, proxy, host, isp, organization, asn, countryCode, city, region, timezone, latitude, longitude, zipCode, isCrawler, connectionType, recentAbuse, abuseVelocity, botStatus, frequentAbuser, highRiskAttacks, sharedConnection, dynamicConnection, securityScanner, trustedNetwork, operatingSystem, browser, deviceBrand, deviceModel, transactionDetails, errors, vpn, tor, activeVpn, activeTor, mobile, fraudScore) Args: ip: valid ip number

Inputs: ip (required).

check_IT_fiscal_codeCheck if Italian Fiscal Code is real and existent in the official databaseC
Read-onlyIdempotent
Inspect

Check if an Italian Fiscal Code is real and existent in the official database. Args: fiscalCode: fiscal code of an italian person

Inputs: fiscalCode (required).

check_license_plateCheck License PlateAInspect

Retrieve vehicle data for a supported country and plate.

Available combinations: IT-car, IT-bike, IT-insurance, FR-car, FR-bike, UK-car, UK-bike, UK-mot, PT-car, PT-insurance, ES-car, ES-bike.

Inputs: type (required), countryCode (required), licensePlate (required).

check_mobile_advancedcheck_mobile_advancedA
Read-onlyIdempotent
Inspect

Retrieves advanced information about a mobile number (requestedNumber, formattedNumber, createdAt, updatedAt, state, message, success, valid, active, localFormat, fraudScore, recentAbuse, voip, prepaid, risky, name, identityData, carrier, lineType, country, region, city, accurateCountryCode, zipCode, timezone, dialingCode, doNotCall, leaked, spammer, activeStatus, mcc, mnc, transactionDetails) Args: mobile: with international prefix es +39

Inputs: mobile (required).

check_mobile_startcheck_mobile_startA
Read-onlyIdempotent
Inspect

Retrieves basic information about a mobile number (requestedNumber, formattedNumber, numberType, isPossible, isValid, regionCode, isValidNumberForRegion, network, originalNetwork, roaming, ported, country, countryPrefix, details) Args: mobile: with international prefix es +39

Inputs: mobile (required).

check_pecCertified email address availability checkB
Read-only
Inspect

Checks if a specific PEC (Certified Email) address is available.

Use this tool when the user asks if a PEC address is available.

Inputs: pec (required).

check_url_advancedcheck_url_advancedB
Read-onlyIdempotent
Inspect

Retrieves advanced information about an url address (url, createdAt, updatedAt, state, requestedUrl, message, success, unsafe, domain, ipAddress, countryCode, languageCode, server, contentType, statusCode, pageSize, domainRank, dnsValid, parking, pageTitle, shortLinkRedirect, hostedContent, riskyTld, spfRecord, dmarcRecord, mxRecords, nsRecords, aRecords, errors, riskScore, suspicious, phishing, malware, spamming, adult, category, technologies, domainAge, redirected, scannedUrl, finalUrl) Args: url: valid url address

Inputs: url (required).

download_italian_company_official_documentDownload Italian Company Official DocumentAInspect

Download a document when the "stato_richiesta" of a get_italian_company_official_document call is "Dati disponibili" Response is a json containing one or more files with attributes: file_name, file_size, download_link, content, expire.

Inputs: document_id (required), document_url (required).

find_IT_istat_by_comune_nameFind It Istat By Comune NameCInspect

Searches for the ISTAT code associated with a given Italian municipality.

Inputs: comune (required).

find_IT_municipalities_by_zipFind It Municipalities By ZipCInspect

Retrieves the list of Italian municipalities and their ISTAT code based on the ZIP code.

Inputs: zip_code (required).

find_IT_municipality_by_istatFind It Municipality By IstatCInspect

Retrieves detailed data about an Italian municipality using the ISTAT code:

  • istat:istatCode

  • comune:municipalityName

  • regione:regionName

  • provincia:provinceName

  • prefisso:telephoneLocalPrefix

  • cod_fisco:cadastralCodeor BelfioreCode of town,

  • superficie:surfaceArea

  • num_residenti:numberOfResidents

  • nome_abitanti:inhabitantsName

  • patrono.nomepatronSaintName,

  • patrono.datapatronSaintDate,

  • municipio:municipalityAddress

  • istat_old:oldIstatCode

  • sigla_provincia:provinceAbbreviation

  • email:emailAddress

  • pec:certifiedEmailAddress

  • tel:telephoneNumber

  • fax:faxNumber

  • frazioni:fractions

  • cap:postalCodes

Inputs: istatCode (required).

geocodeGeocodeBInspect

Retrieve informations about a place supplying address.

To improve success of results, use the format: [street], [city] [postal code] [country].

Inputs: address (required).

get_company_EU_advancedEuropean/Worldwide advanced company dataC
Read-onlyIdempotent
Inspect

Returns advanced company information for a company in the specified country.

Returns detailed company data including financial highlights or extended registry info where available.

Inputs: vatCode (required), country_code (required).

get_company_EU_startEuropean/Worldwide basic company dataA
Read-onlyIdempotent
Inspect

Returns basic company information for a company in the specified country.

Returns companyName, vatCode, address, activityStatus, and other basic details.

Inputs: vatCode (required), country_code (required).

get_company_IT_advancedAdvanced italian companies data from VATB
Read-onlyIdempotent
Inspect

Returns taxCode, companyName, vatCode, address, activityStatus, reaCode, cciaa, atecoClassification, detailedLegalForm, startDate, registrationDate, endDate, pec, taxCodeCeased, taxCodeCeasedTimestamp, vatGroup, sdiCode, sdiCodeTimestamp, balanceSheets (turnover, employee, networt, staffCost, totalAssets.avgGrossSalary of the last 10 years), shareHolders of an italian company from vatCode or taxCode. Args: vat_or_taxCode: vatCode or taxCode of an italian company

Inputs: vat_or_taxCode (required).

get_company_IT_fullFull italian companies data from VATB
Read-onlyIdempotent
Inspect

Returns the complete and detailed profile of an Italian company.

The lookup uses a VAT number or Tax Code. - Company Data (Name, VAT Number, Tax Code, CCIAA, and REA) - Managers - Registered Office and other types of offices - Activity Classifications (New ATECO 2025, ATECO history since 2022, NACE, SIC, RAE, and SAE) - Corporate Affiliation - Exporter / Importer Status - Company Size - Company Contacts (Email, phone, fax, website, social media) - Shareholders and their ownership shares - Employees, number, trends, statistics on contract duration and types - Regarding shareholders, it is possible to access the list of the top 10 (based on ownership share size) and view their respective ownership shares. - Liquidity and profitability - Receivables and Payables - EBITDA and EBIT - Cashflow with a 2-year history - Financial fixed assets - Production value and costs - Financial revenues and expenses - Tangible, intangible, and financial assets - Net profit/loss Use get_company_IT_search to obtain VAT Args: vat_or_taxCode: VAT number or Tax Code of an Italian company

Inputs: vat_or_taxCode (required).

get_company_IT_startStart italian companies data from VATB
Read-onlyIdempotent
Inspect

Returns taxCode, companyName, vatCode, address, activityStatus, sdiCode, registrationDate of an italian company from vatCode or taxCode. Args: vat_or_taxCode: vatCode or taxCode of an italian company

Inputs: vat_or_taxCode (required).

get_company_WW_advancedWorldwide advanced company dataB
Read-onlyIdempotent
Inspect

Returns advanced company information for a company worldwide. Args: vatCode: VAT code or company registration number country_code: Two-letter country code of the country

Inputs: vatCode (required), country_code (required).

get_company_WW_startWorldwide basic company dataB
Read-onlyIdempotent
Inspect

Returns basic company information for a company worldwide. Args: vatCode: VAT code or company registration number country_code: Two-letter country code of the country

Inputs: vatCode (required), country_code (required).

get_company_WW_topStart worldwide companies data from VAT or company numberB
Read-onlyIdempotent
Inspect

Returns worldwide top company data.

Includes company name, native company name, company size, address, GPS, activity status, incorporation date, contacts, classifications, and key balance sheet highlights.

Inputs: country_code (required), vat_or_taxCode (required).

get_docuengine_documentsGet Docuengine DocumentsCInspect

Returns the download links for the documents produced by a request.

Inputs: request_id (required).

get_docuengine_request_statusGet Docuengine Request StatusCInspect

Returns the details and status of a specific DocuEngine request.

Inputs: request_id (required).

get_docuengine_servicesGet Docuengine ServicesAInspect

Returns the list of all available DocuEngine services with their required parameters.

Inputs: no named parameters.

get_italian_company_official_documentGet Italian Company Official DocumentBInspect

Retrieves an official company registry document (visura camerale) for a company identified by its VAT number or tax code. Args: document_url: url of the requested document vat_or_taxCode: vatCode or taxCode of an italian company

Inputs: document_url (required), vat_or_tax_code (required).

get_italian_company_official_documents_listGet Italian Company Official Documents ListBInspect

Returns the list of available official company registry document endpoints for a company, identified by its VAT number or tax code. Use with get_italian_company_official_document. Args: vat_or_taxCode: vatCode or taxCode of an italian company

Inputs: vat_or_tax_code (required).

get_IT_metropolitan_cities_listGet It Metropolitan Cities ListAInspect

Returns the list of Italian metropolitan cities

Inputs: no named parameters.

get_IT_provinces_listGet It Provinces ListCInspect

Returns the list of Italian provinces

Inputs: no named parameters.

get_IT_regions_listGet It Regions ListBInspect

Returns the list of Italian regions

Inputs: no named parameters.

get_risk_IT_creditscore_topProvides detailed credit score information for a specific organization using a tax code, VAT numberB
Read-onlyIdempotent
Inspect

Returns detailed credit score information for an Italian company.

Inputs: vat_or_taxCode (required).

get_suppressed_italian_municipalitiesGet Suppressed Italian MunicipalitiesBInspect

Returns the list of suppressed or merged Italian municipalities

Inputs: no named parameters.

get_today_exchange_ratesGet Today Exchange RatesBInspect

Obtain daily world exchange rates based on USD value.

Inputs: no named parameters.

openapi_server_infoOpenapi Server InfoAInspect

Call this tool whenever the user asks:

  • "are you connected to openapi?" / "sei connesso a openapi?"

  • "which server / instance is running?"

  • "what is your status?" / "are the tools working?"

  • any question about connectivity, health, or identity of this MCP server.

Returns live diagnostic data directly from the running process — no external API calls are made. The response includes:

  • server name, version, and mode (sandbox vs production)

  • instance identity: user@hostname, PID, and startup timestamp so different running instances (local dev, staging, Cloud Run) are immediately distinguishable

  • token status: whether OPENAPI_TOKEN / OPENAPI_SANDBOX_TOKEN are set in the server environment, with a masked preview of the active token

  • list of all MCP tools currently registered and available

  • session identifiers for the current request

Inputs: no named parameters.

post_risk_WW_kyc_fullFull Worldwide KYC FULLB
Read-onlyIdempotent
Inspect

Create a full KYC request on a subject.

Covers politically exposed persons, adverse media, local politicians, legal enforcement, sanctions, and whitelists. Use name for entity types L, W, VE, AC, NA or firstName and lastName for entity type I.

Inputs: name (required), lastName (required), firstName (required), entityType (required).

reverse_geocodeReverse GeocodeBInspect

Get place information from ID or latitude/longitude:

To obtain infos via ID make sure to pass the following format: {"type": "id", "id": ""}

To obtain infos via lat/long, make sure to provide the following format: {"type": "coordinates", "lat": "", "long": ""}

Inputs: id (required), lat (required), long (required), type (required).

send_smsSend SmsCInspect

Send an SMS to a mobile number using minus sign to separate international prefix from the number Args: sender: optional, can be a 11 char long string body: the body of the message string mobile: the recipient mobile number. Eg.:"+39-1234567890"

Inputs: body (required), mobile (required), sender (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 41 tools

    Disambiguation3/5

    The set spans many distinct services, but several tools overlap in purpose: get_company_IT_start/advanced/full/search, get_company_WW_start/advanced/top, and the email/mobile start vs advanced variants require careful reading to select correctly. Descriptions help clarify depth and country, but tier names like 'top' versus 'advanced' and 'full' versus official-document tools leave some ambiguity.

    Naming Consistency3/5

    Most names are snake_case, but conventions are mixed: uppercase country tokens (IT, WW, FR, EU) coexist with 'italian', and verbs vary across find_, get_, check_, post_, send_, download_, geocode, and openapi_server_info. The names remain readable, but there is no single predictable verb_noun pattern across all 41 tools.

    Tool Count2/5

    With 41 tools, the surface is very heavy for an MCP server and exceeds the typical 3-15 well-scoped range. The broad multi-service suite may justify many endpoints, but the lack of grouping and the presence of multiple tier variants make the set unwieldy for reliable tool selection.

    Completeness3/5

    Coverage is broad across municipality, company, validation, geocoding, SMS, KYC, document, and exchange-rate lookups, but it is uneven. There are notable gaps such as no basic IP/URL checks, inconsistent search coverage for some country company tools, and DocuEngine appears to expose services/status/documents without a clear request-submission operation.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Transforms OpenAPI specs into an MCP server, enabling dynamic API interaction through natural language with automatic authentication and endpoint discovery.
      131 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Transforms Swagger/OpenAPI documented APIs into conversational interfaces, enabling natural language interaction with APIs through an MCP server for use with AI assistants.
      4
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables LLMs to interact with any REST API that has an OpenAPI specification by providing a lightweight MCP server that translates between natural language and API calls.
      MIT