Λογότυπο GhostApi

GhostApi

Κοινότητα
yiaany

Local API simulation and test evidence for AI-assisted development.

Εκδότηςyiaany
Αποθετήριοghostapi
ΓλώσσαTypeScript
Forks
2
Αστέρια
51
Διαθέσιμα εργαλεία
0
Τύπος μεταφοράςstdio
Κατηγορίες
Άδεια χρήσηςMIT
Σύνδεσμοι
  • Συνδέστε εργαλεία σε ροές εργασίας AI

    Το GhostApi παρέχει δυνατότητες MCP που μπορούν να χρησιμοποιηθούν από συμβατές εφαρμογές-πελάτες AI και πράκτορες AI.

  • 0 διαθέσιμα εργαλεία

    Περιηγηθείτε παρακάτω στις ενέργειες που μπορούν να κληθούν, μαζί με τα ονόματα και τις περιγραφές τους, όταν παρέχονται από τον διακομιστή.

  • Ρυθμίσεις έτοιμες για αντιγραφή

    Χρησιμοποιήστε τα αποσπάσματα εγκατάστασης για να ρυθμίσετε αυτόν τον διακομιστή στην εφαρμογή-πελάτη MCP που προτιμάτε.

  • Δείκτες ενδιαφέροντος για τον ανοιχτό κώδικα

    51 αστέρια και 2 διακλαδώσεις στο συνδεδεμένο αποθετήριο.

Why GhostAPI

Coding agents can write a Stripe checkout, an OpenAI workflow, a GitHub automation, or an email integration in minutes. The dangerous part is what happens when they run that code.

When a client is configured against a live provider, a test can:

  • charge a real card;
  • send a real email or SMS;
  • create or modify real GitHub resources;
  • spend API credits;
  • leak credentials into logs, prompts, screenshots, or test fixtures.

GhostAPI provides a local endpoint at 127.0.0.1:8080. Requests sent to that endpoint are classified, heuristically sanitized, recorded in bounded local stores, and answered by implemented provider packs or generic fallback behavior. You can inspect the result in the dashboard, control local behavior through MCP, and turn captured failures into repeatable tests.

Verified Locally, Not Customer-Validated Yet

The public repository contains reproducible tests for local provider simulation, Linux namespace enforcement, package installation, and hosted-pilot authorization. GhostAPI does not yet claim production customers, paid pilots, or a deployed team service.

Quickstart

Start the local server and dashboard:

bash
npx @yiaany/ghostapi start --open

Send a Stripe-shaped request:

bash
curl -X POST http://127.0.0.1:8080/v1/customers \
  -H "content-type: application/json" \
  -H "authorization: Bearer stripe_test_ghostapi" \
  -d '{"email":"ada@example.com","name":"Ada Lovelace"}'

Open the dashboard at http://127.0.0.1:8080/dashboard. The request appears in live traffic with its provider, request body, generated response, source, status, and timing.

Initialize GhostAPI inside an existing repository:

bash
npx @yiaany/ghostapi init
npx @yiaany/ghostapi doctor

init creates local configuration, a versioned safety policy, MCP snippets, and agent instructions without overwriting existing files.

On a supported Linux host, run a command inside the loopback-only network namespace:

bash
npx @yiaany/ghostapi run -- npm test

On Windows and macOS, ghostapi run fails closed because an equivalent process-isolation backend is not implemented. The local API server and dashboard still work normally.

What You Get

FeatureWhat it does
Local API simulationGives explicitly configured SDKs and applications a local target instead of a live provider.
Provider-shaped behaviorReturns deterministic objects and errors shaped like the implemented subset of each provider API; it does not claim live-provider parity.
Live dashboardShows requests and responses, filters traffic by provider, generates tests, and arms scenarios.
MCP control planeLets compatible coding agents inspect state, read traffic, configure responses, and toggle Chaos Mode.
Stateful synthetic worldsMaintains deterministic local identities and state across Stripe, GitHub, email, and REST projections.
Scenarios and record/replaySaves sanitized sandbox traffic and replays it offline as deterministic fixtures.
Contract drift checksImports bounded OpenAPI/HAR contracts and classifies breaking, non-breaking, and uncertain changes.
Agent evals and evidenceProduces bounded reports with a local self-consistency hash, verifiable while the runtime and local storage remain trusted.
Secret-risk reductionHeuristically masks recognized secret-shaped headers, query parameters, bodies, paths, events, prompts, and cache inputs.
Fault testingForces latency, provider errors, card declines, rate limits, and other unhappy paths.
Safety controlsIncludes local approvals, scoped budgets, kill switches, circuit breakers, ledgers, and reconciliation for synthetic actions.
Reliability toolingTracks local SLO samples, cost attribution, runtime health, backups, inventory, and attack-path metadata.

Dashboard

The dashboard is the fastest way to understand what an agent or application actually did.

  • Watch traffic arrive in real time over SSE.
  • Inspect sanitized request and response JSON.
  • Filter by Stripe, Twilio, Resend, GitHub, Discord, OpenAI, or generic REST.
  • Generate a Vitest test from a captured request.
  • Generate and copy setup files for supported coding agents.
  • Arm deterministic scenario presets.
  • Toggle Chaos Mode and inspect the local safety report.

Dashboard and API routes are token-protected on every non-loopback bind. Use HTTPS or a secure tunnel when exposing GhostAPI beyond localhost.

Provider Support

GhostAPI has two levels of provider support.

Stateful provider packs

ProviderIncluded behavior
StripeCustomers, products, prices, subscriptions, invoices, payment intents, payment methods, checkout sessions, refunds, pagination, lifecycle scenarios, and signed local webhooks.
ResendDeterministic email-shaped requests, responses, validation, and failure behavior.

Provider-shaped adapters and generic inference

OpenAI, Twilio, GitHub, Discord, and generic REST routes are detected and receive provider-shaped synthetic responses and errors. These adapters are useful for local development, but they do not claim complete parity with live-provider endpoints.

Unsupported Stripe and Resend pack operations fail diagnostically. Legacy adapters and generic REST inference may return a synthetic fallback response for unrecognized routes; such responses do not indicate provider support or parity.

SDK Setup

Stripe:

ts
import Stripe from "stripe";

export const stripe = new Stripe(
  process.env.STRIPE_SECRET_KEY ?? "stripe_test_ghostapi",
  {
    host: process.env.GHOSTAPI_HOST ?? "127.0.0.1",
    port: Number(process.env.GHOSTAPI_PORT ?? "8080"),
    protocol: process.env.GHOSTAPI_PROTOCOL ?? "http",
  },
);

OpenAI:

ts
import OpenAI from "openai";

export const openai = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY ?? "sk-ghostapi",
  baseURL: process.env.GHOSTAPI_OPENAI_BASE_URL ?? "http://127.0.0.1:8080/v1",
});

Generic REST:

bash
curl -X POST http://127.0.0.1:8080/tasks \
  -H "content-type: application/json" \
  -d '{"title":"Add integration tests","status":"open"}'

MCP For Agents

Start the MCP server:

bash
npx @yiaany/ghostapi mcp

Generic MCP configuration:

json
{
  "mcpServers": {
    "ghostapi": {
      "command": "npx",
      "args": ["-y", "@yiaany/ghostapi@0.2.1", "mcp"]
    }
  }
}

Available tools:

ToolPurpose
inspect_stateRead current local API objects.
get_traffic_logsInspect sanitized recent traffic.
set_api_behaviorForce a deterministic response for a method and path.
toggle_chaos_modeEnable or disable local latency and failure injection.

Generate setup snippets for Cursor, Claude, Cline, Aider, Codex, OpenCode, Gemini CLI, Goose, OpenClaw, Hermes, and generic MCP clients:

bash
npx @yiaany/ghostapi setup --write

Connect only trusted local MCP clients. MCP tools can read retained traffic and state and can modify local simulation behavior; MCP is not an authentication or egress boundary. Pin the package version in persistent MCP configuration or use a reviewed local installation.

Scenarios, Contracts, And Evals

Record approved sandbox traffic into a sanitized offline bundle:

bash
ghostapi record \
  --input capture.har \
  --allow-sandbox-host api.sandbox.example \
  --approve

Replay it without network access:

bash
ghostapi replay bundle.json --requests requests.json

Import and compare API contracts:

bash
ghostapi contract import-openapi --input openapi.json
ghostapi contract diff \
  --baseline base.contract.json \
  --candidate head.contract.json \
  --policy ghostapi.policy.yaml \
  --ci

Generate sanitized CI evidence:

bash
ghostapi evidence generate --policy ghostapi.policy.yaml --ci

Run a deterministic agent eval:

bash
ghostapi eval \
  --template retry-after \
  --evidence .ghostapi/reports/latest.json \
  --ci

Security Boundaries

GhostAPI uses local-first defaults, explicit external-LLM opt-in, and heuristic secret masking. Its boundaries are explicit:

  • Real provider calls are disabled by default.
  • Ambient OPENAI_API_KEY does not enable external generation.
  • External LLM generation requires an explicit flag plus a separate GHOSTAPI_LLM_API_KEY.
  • On non-loopback binds, every route except / and /health requires a strong GHOSTAPI_AUTH_TOKEN. The token provides access control, not encryption.
  • External response redirects, unsafe response headers, traversal, remote schema references, symlinks, archives, and oversized inputs are rejected where applicable.
  • Persistent stores have size, entry, retention, or rotation limits.
  • The Linux run backend provides loopback-only process network isolation when namespace preflight succeeds.
  • run is not a hostile-code filesystem sandbox.
  • Secret masking is heuristic and incomplete. Use synthetic credentials and data even in local fixtures.
  • Local approval, action, credential, ledger, trust, and safety components execute synthetic operations only. They are not a production-provider executor.
  • Evidence hashes are local self-consistency checks, not signatures, immutable provenance, or proof against a same-user editor.
  • Current run evidence records namespace lifecycle and GhostAPI-local traffic; it does not enumerate kernel-denied socket attempts.

Read the detailed threat models in docs/security and the reporting policy in SECURITY.md.

Explicit Non-Goals

  • No live-provider parity guarantee.
  • No complete secret-redaction guarantee.
  • No hostile-code filesystem sandbox.
  • No equivalent process-egress enforcement on Windows or macOS.
  • No deployed hosted service, SLA, compliance certification, or production credential executor.

Platform Support

PlatformLocal API and dashboardghostapi run enforcement
LinuxSupported on Node.js 20+Supported when unshare, iproute2, and namespace preflight pass.
WindowsSupported on Node.js 20+Not implemented; fails closed.
macOSSupported on Node.js 20+Not implemented; fails closed.

Check the current machine:

bash
ghostapi doctor --json
ghostapi doctor --egress

Health Endpoints

text
GET /health             process liveness, HTTP 200 while state can be evaluated
GET /health/readiness   structural readiness, HTTP 503 when a required store is unsafe

Hosted Experiment

No hosted or enterprise service is currently available. The hosted/ directory is an undeployed experimental implementation, excluded from the npm package and unsupported for production use. Its live OAuth, dependency, migration, load, failover, backup, and disaster-recovery behavior has not been proven in staging.

Development

bash
npm ci
npm run lint
npm run typecheck
npm test
npm run test:coverage
npm run build
npm run smoke:package

Hosted pilot checks:

bash
cd hosted
npm ci
npm run check

See CONTRIBUTING.md, PROVENANCE.md, and docs/releases/ for the contribution and release boundaries.

Documentation

License

MIT. See LICENSE.

Χρησιμοποιήστε το MCP GhostApi με πολλά μοντέλα AI

Το TypingMind συνδέει τα εργαλεία MCP σε επίπεδο χώρου εργασίας. Έτσι, μόλις συνδεθεί το GhostApi, μπορείτε να το χρησιμοποιείτε με διαφορετικά μοντέλα AI στο TypingMind, αντί να το ρυθμίζετε ξεχωριστά για κάθε μοντέλο. Αυτή η ενσωμάτωση MCP εκτελείται τοπικά στη συσκευή σας μέσω του συνδέσμου MCP του TypingMind.

Οδηγός ρύθμισης για τη χρήση του τοπικού συνδέσμου

Επιλέξτε αυτή τη μέθοδο όταν ο διακομιστής MCP χρειάζεται πρόσβαση σε τοπικά αρχεία, εφαρμογές ή ιδιωτικούς πόρους στον υπολογιστή σας.

1

Ανοίξτε τις ρυθμίσεις MCP

Στο TypingMind, μεταβείτε στις «Ρυθμίσεις», έπειτα στις «Σύνθετες ρυθμίσεις» και στο «Model Context Protocol» και επιλέξτε «Ρύθμιση συνδέσμου».

  1. Ανοίξτε το TypingMind στο πρόγραμμα περιήγησής σας.
  2. Κάντε κλικ στο εικονίδιο «Ρυθμίσεις».
  3. Μεταβείτε στις «Σύνθετες ρυθμίσεις».
  4. Ανοίξτε την ενότητα Model Context Protocol.
  5. Κάντε κλικ στην επιλογή «Ρύθμιση συνδέσμου» και επιλέξτε «Αυτή η συσκευή».
Οθόνη ρύθμισης συνδέσμου MCP του TypingMind με επιλεγμένη την επιλογή «Αυτή η συσκευή»
2

Εκτελέστε την εντολή του συνδέσμου

Επιλέξτε «Αυτή η συσκευή», αντιγράψτε την εντολή από το TypingMind και εκτελέστε την στο Τερματικό. Διατηρήστε τη διεργασία σε λειτουργία όσο χρησιμοποιείτε το MCP.

  1. Αντιγράψτε την εντολή ρύθμισης που εμφανίζεται στο TypingMind.
  2. Ανοίξτε το Τερματικό στο macOS ή το Windows Terminal στα Windows.
  3. Επικολλήστε και εκτελέστε την εντολή.
  4. Εγκρίνετε την εγκατάσταση του πακέτου, αν το Τερματικό σάς ζητήσει επιβεβαίωση για να συνεχίσει.
  5. Διατηρήστε ανοιχτό το παράθυρο του Τερματικού και τη διεργασία σε λειτουργία όσο χρησιμοποιείτε εργαλεία MCP.
3

Προσθέστε το GhostApi ως διακομιστή

Όταν η κατάσταση του συνδέσμου είναι «Έτοιμος», κάντε κλικ στο «Αλλαγή servers» και επικολλήστε τις ρυθμίσεις του διακομιστή MCP.

  1. Περιμένετε μέχρι η κατάσταση του συνδέσμου να εμφανιστεί ως «Έτοιμος».
  2. Κάντε κλικ στο «Αλλαγή servers».
  3. Επικολλήστε τις ρυθμίσεις του διακομιστή MCP GhostApi.
  4. Αποθηκεύστε τη λίστα διακομιστών.
  5. Κάντε ανανέωση αν θέλετε να επιβεβαιώσετε ότι ο σύνδεσμος παραμένει έτοιμος για χρήση.
Ρυθμίσεις MCP του TypingMind με ενεργό διακομιστή και το κουμπί «Αλλαγή servers»
{
  "mcpServers": {
    "ghostapi": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Χρησιμοποιήστε τη σύνδεση με διαφορετικά μοντέλα

Αποθηκεύστε τη λίστα διακομιστών, ανοίξτε τα «Πρόσθετα», ενεργοποιήστε τα εργαλεία MCP του GhostApi και έπειτα επιλέξτε οποιοδήποτε υποστηριζόμενο μοντέλο AI στο TypingMind. Χρησιμοποιήστε τα εργαλεία στη συνομιλία ή αναθέστε τα σε έναν πράκτορα AI.

  1. Ανοίξτε τη σελίδα «Πρόσθετα» στο TypingMind.
  2. Ενεργοποιήστε τα εργαλεία MCP του GhostApi.
  3. Ξεκινήστε μια συνομιλία και επιλέξτε το μοντέλο AI που θέλετε να χρησιμοποιήσετε.
  4. Χρησιμοποιήστε τα εργαλεία MCP στη συνομιλία ή αντιστοιχίστε τα σε έναν πράκτορα AI.
  5. Μεταβείτε σε άλλο μοντέλο AI όποτε χρειάζεται, χωρίς να συνδέσετε ξανά το MCP.
Συνομιλία στο TypingMind με ενεργοποιημένα εργαλεία MCP και επιλεγμένο μοντέλο AI
Θα με βοηθήσετε σε αυτό μέσω GhostApi;
GhostApi
Βεβαίως. Το διάβασα.
Δείτε τι βρήκα μέσω του GhostApi.

Συχνές ερωτήσεις

Σε τι χρησιμεύει ο διακομιστής MCP GhostApi;

Το GhostApi είναι ένας διακομιστής MCP που επιτρέπει σε συμβατές εφαρμογές AI να συνδέονται με εξωτερικά εργαλεία και πληροφορίες πλαισίου. Στο TypingMind, μπορείτε να προσθέσετε αυτόν τον διακομιστή MCP μία φορά και να κάνετε τα εργαλεία του διαθέσιμα στον χώρο εργασίας AI σας.

Μπορώ να χρησιμοποιήσω το GhostApi MCP με πολλά μοντέλα AI στο TypingMind;

Ναι. Το TypingMind συνδέει τα εργαλεία MCP σε επίπεδο χώρου εργασίας, ώστε να μπορείτε να χρησιμοποιείτε το GhostApi με διαφορετικά μοντέλα AI, όπως τα Claude, ChatGPT, Gemini ή άλλα μοντέλα που έχετε ρυθμίσει στο TypingMind, χωρίς να ρυθμίζετε τον διακομιστή MCP ξεχωριστά για κάθε μοντέλο.

Γιατί να χρησιμοποιήσετε τον σύνδεσμο MCP GhostApi με το TypingMind;

Το TypingMind είναι ένα από τα καλύτερα περιβάλλοντα συνομιλίας με μεγάλα γλωσσικά μοντέλα, καθώς συγκεντρώνει πολλά μοντέλα AI, προτροπές, πρόσθετα, πράκτορες AI, κλειδιά API και εργαλεία MCP σε έναν χώρο εργασίας. Συνδέοντας το GhostApi, μπορείτε να χρησιμοποιείτε τα εργαλεία MCP του με τα μοντέλα που προτιμάτε, διατηρώντας οργανωμένη τη ροή εργασίας των συνομιλιών σας στο TypingMind.

Πώς συνδέω το GhostApi MCP στο TypingMind;

Το GhostApi λειτουργεί μέσω του τοπικού συνδέσμου MCP του TypingMind. Αυτή είναι η καλύτερη επιλογή όταν ο διακομιστής MCP χρειάζεται πρόσβαση σε τοπικά αρχεία, εφαρμογές υπολογιστή, εργαλεία γραμμής εντολών ή ιδιωτικούς πόρους στον υπολογιστή σας.

Ποια εργαλεία παρέχει το GhostApi MCP στο TypingMind;

Το GhostApi διαθέτει δυνατότητες MCP που μπορείτε να ενεργοποιήσετε από τη σελίδα Πρόσθετα του TypingMind και να χρησιμοποιήσετε σε συνομιλίες ή να αναθέσετε σε πράκτορες AI.

Χρειάζεται να κοινοποιήσω τα κλειδιά API μου στο TypingMind για να χρησιμοποιήσω το GhostApi MCP;

Όχι. Το TypingMind δίνει προτεραιότητα στην τοπική λειτουργία και σας επιτρέπει να διατηρείτε τον έλεγχο των παρόχων μοντέλων, των κλειδιών API, των προτροπών και των ρυθμίσεων MCP σας. Αν το GhostApi απαιτεί έλεγχο ταυτότητας, προσθέστε τις απαιτούμενες κεφαλίδες, τις ρυθμίσεις OAuth ή τις τοπικές ρυθμίσεις για τον συγκεκριμένο διακομιστή MCP κατά τη δημιουργία της σύνδεσης.

Σχετικοί διακομιστές MCP

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇