Quickstart
Connect an API spec, choose CLI, MCP, or SDK Targets, and make your first request with a generated package.
Generate a package from the hosted Petstore spec, then make a request with it. Once the sample works, connect your own OpenAPI or GraphQL spec.
https://typeship.dev/examples/petstore/openapi.yamlThe sample needs no API credentials.
To generate a package, use the Typeship CLI or the Console:
| Generate with | You need |
|---|---|
| Typeship CLI | The Typeship executable; no Typeship sign-in required |
| Console | Sign in to Typeship |
To run the package you generate:
| Target | You need |
|---|---|
| CLI | An executable built from the source package; see its README for build requirements |
| MCP server or TypeScript SDK | Node.js 20 or later and npm |
| MCP server in Claude Code | Claude Code, signed in |
| Python SDK | Python 3.11 or later |
| Go SDK | Go 1.21 or later |
Choose your targets
| Your users need | Choose |
|---|---|
| Commands for terminals and scripts | CLI |
| Tools for an MCP client | MCP server |
| A library for TypeScript applications | TypeScript SDK |
| A library for Python applications | Python SDK |
| A library for Go applications | Go SDK |
cli generates a standalone executable and is the initial selection for a new Project. A saved Project can maintain any non-empty combination. Each Target is independent, so you can add another later. See Choose targets for configuration and delivery choices.
Connect and generate
Generate the CLI from your working directory:
typeship packages generate \
--spec '{"url":"https://typeship.dev/examples/petstore/openapi.yaml"}' \
--target '{"type":"cli"}' \
--out ./generated/cli--target takes a JSON descriptor. To generate another sample Target, change type to mcp, typescript_sdk, python_sdk, or go_sdk, and give it its own --out directory. Each tab under Use the result shows the full command for its Target.
The Typeship CLI operates Typeship. One-shot generation saves no Project. Check the printed summary for warnings and omitted operations. For protected sources, see Generate from a URL. To maintain multiple Targets together, create a Project.
Anonymous and Free generation include 25 operations per Target. A Free Project retains the complete Spec even when a Generation omits operations. A successful Generation does not by itself mean every operation was included.
Use the result
Choose the tab for your Target. Each tab starts with its generation command; skip it if you already generated that Target above. If you downloaded an artifact from the Console, open the extracted directory containing the README and manifest instead.
These commands use the hosted Petstore spec. For your own API, its generated README replaces the sample's package names, operations, inputs, and credentials.
Generate from your working directory:
typeship packages generate \
--spec '{"url":"https://typeship.dev/examples/petstore/openapi.yaml"}' \
--target '{"type":"cli"}' \
--out ./generated/cliThen run cd generated/cli. If you downloaded this Target from the Console, open its extracted package directory instead.
Build your CLI
With the toolchain version listed in the generated README installed, run from the generated CLI directory:
go build -o petstore .
./petstore pets list --helpMake your first request
The sample exposes one read operation, pets list:
./petstore pets list --jsonThe command prints the pets as JSON. It exits nonzero if the request fails.
Generate from your working directory:
typeship packages generate \
--spec '{"url":"https://typeship.dev/examples/petstore/openapi.yaml"}' \
--target '{"type":"mcp"}' \
--out ./generated/mcpThen run cd generated/mcp. If you downloaded this Target from the Console, open its extracted package directory instead.
This path connects a downloaded local MCP package. It needs Node.js 20 or later, npm, and Claude Code. You do not need a generated CLI Target or a hosted Delivery.
Build the MCP package, then add its local executable to Claude Code from that directory:
npm install
npm run build
claude mcp add --scope local petstore -- node "$(pwd)/dist/mcp.js"
claude mcp list
claudeThe server selects the supported protocol automatically. On Windows PowerShell, replace $(pwd)/dist/mcp.js with the absolute path to the built file. In Claude Code, allow the local server connection when prompted, then ask:
List the petstore server's tools, then call pets_list with no arguments.
Show the returned JSON.Discovery should include pets_list. Its successful result contains the sample pet shown below. Claude Code connects with its default protocol settings; if the client reports an unsupported protocol version, update it and check the client compatibility guidance. For a missing executable, check the absolute path. Follow MCP connection troubleshooting.
A hosted MCP endpoint is a separate connection using a URL. See Connect MCP clients after adding a hosted Delivery to a saved Project.
Generate from your working directory:
typeship packages generate \
--spec '{"url":"https://typeship.dev/examples/petstore/openapi.yaml"}' \
--target '{"type":"typescript_sdk"}' \
--out ./generated/typescriptThen run cd generated/typescript. If you downloaded this Target from the Console, open its extracted package directory instead.
Build the package with Node.js 20 or later and npm:
npm install
npm run buildSave example.mjs beside package.json:
import { PetstoreClient } from "./dist/index.js";
const pets = await new PetstoreClient({}).pets.list();
console.log(JSON.stringify(pets));node example.mjsGenerate from your working directory:
typeship packages generate \
--spec '{"url":"https://typeship.dev/examples/petstore/openapi.yaml"}' \
--target '{"type":"python_sdk"}' \
--out ./generated/pythonThen run cd generated/python. If you downloaded this Target from the Console, open its extracted package directory instead.
Use Python 3.11 or later. From the directory containing pyproject.toml, create an environment and install the local package:
python3 -m venv .venv
.venv/bin/python -m pip install .On Windows, use .venv\Scripts\python.exe in place of .venv/bin/python.
Save example.py beside pyproject.toml:
import json
from petstore import PetstoreClient
with PetstoreClient() as client:
print(json.dumps(client.pets.list())).venv/bin/python example.pyA failed request raises an exception. Read the error before retrying.
Generate from your working directory:
typeship packages generate \
--spec '{"url":"https://typeship.dev/examples/petstore/openapi.yaml"}' \
--target '{"type":"go_sdk"}' \
--out ./generated/goThen run cd generated/go. If you downloaded this Target from the Console, open its extracted package directory instead.
Use Go 1.21 or later. In the directory containing go.mod, create cmd/example/main.go:
package main
import (
"context"
"encoding/json"
"os"
"example.com/petstore-go"
)
func main() {
client, err := petstore.New()
if err != nil { panic(err) }
pets, err := client.Pets.List(context.Background())
if err != nil { panic(err) }
if err := json.NewEncoder(os.Stdout).Encode(pets); err != nil { panic(err) }
}go run ./cmd/exampleexample.com/petstore-go is the module declared in this local sample's go.mod. The command builds it locally; no published module is required.
Each sample read returns the same data, with whitespace depending on the client:
[{"id":"pet_1","name":"Mochi"}]The sample needs no login or token. A successful response containing pet_1 and Mochi confirms that the generated package reached the API.
Connect to your API
When you replace the sample spec, credentials serve different purposes: Typeship credentials manage your Project, source headers fetch a protected spec, and your API's credentials authenticate generated requests.
For a generated CLI, follow ./petstore login --help to supply credentials or start a configured browser login. MCP users follow their connection's credential instructions. SDK users pass credentials to their generated client. See Authentication.
If a step fails
| Problem | Next action |
|---|---|
| Typeship cannot fetch or parse the spec | Check source access and debug the spec. |
| A build cannot find its manifest or source files | Open the extracted Target directory, then follow its README. |
| An operation is missing | Check warnings and omitted-operation counts. Names and coverage depend on the spec and plan. |
| Your API rejects authentication | Use your API's credentials. For a CLI, inspect auth check --format json; for GraphQL, check its endpoint and authentication settings. |
| One Target fails while another succeeds | Inspect the failed Target's Generation; results are independent. Follow Troubleshooting. |
Next steps
Keep automatic generation on to receive reviewed updates as your spec or saved settings change. When the package is ready for users, publish it. To adjust shared behavior, open Project configuration.