Skip to main content
GitHub Copilot writes code directly into your repo across VS Code, Visual Studio, JetBrains, the Copilot CLI, and GitHub.com (in chat, code review, and the Copilot cloud agent). It doesn’t host your app, it produces the code that ships to your platform. This guide shows you how to configure Copilot so the Firma integration code it generates is correct on the first pass. This guide covers three setup steps:
  1. Connect the Firma Docs MCP — Copilot reads accurate Firma endpoints and payloads while working
  2. Add a repo-wide instructions file — Persistent Firma conventions every Copilot session in this repo picks up
  3. Reference patterns — Code shapes Copilot should match for create-and-send, webhooks, and embedded signing

Prerequisites

  • A Firma account with an API key
  • GitHub Copilot enabled in your IDE or via the Copilot CLI
  • A repo where you want to add e-signatures

Step 1: Connect the Firma Docs MCP server

Firma ships a Docs MCP server that exposes the full documentation as searchable tools. With it connected, Copilot queries real endpoints, current request shapes, and webhook payload schemas instead of guessing.

VS Code (workspace-level)

Create or edit .vscode/mcp.json in your repo:
Reload the window. In the Copilot Chat panel, open the tools picker and confirm firma-docs shows up.

Copilot CLI (global)

Add it to ~/.copilot/mcp-config.json:
Restart the CLI. Run /mcp show to confirm the server is connected.

JetBrains

Click the GitHub Copilot icon in the status bar, select Edit Settings, then navigate to Model Context Protocol and click Configure. Add the firma-docs server with the URL https://docs.firma.dev/mcp.

Visual Studio

In the Chat pane, switch to Agent mode, click the Tools picker (”+”), and select Add custom MCP server. Enter firma-docs as the name and https://docs.firma.dev/mcp as the URL. Alternatively, add the entry directly to your project’s .mcp.json file. The Docs MCP is read-only and unauthenticated, so you do not pass an API key to it. It only provides documentation.

Step 2: Add a repo-wide Copilot instructions file

.github/copilot-instructions.md is loaded automatically by Copilot Chat, the Copilot cloud agent, and Copilot code review across every supported environment. Drop Firma conventions here so Copilot always generates code that matches Firma’s API contract. Create the file at .github/copilot-instructions.md (or append to it if it already exists):
Commit this file. From now on, any prompt like “add a Firma signing request when the user clicks Send Contract” will start with the right defaults baked in.

Optional: path-specific instructions

If your repo has a clear backend boundary, add a more specific instruction file at .github/instructions/firma.instructions.md:
This is loaded only when Copilot is editing files that match the applyTo glob, keeping the global instructions short.

Step 3: Reference implementation patterns

Copilot generates code in whatever language matches the surrounding files. The shapes below are the canonical Firma calls. The instructions file steers Copilot toward them and the MCP fills in current details.

Create and send (TypeScript)

Create and send (Python)

Webhook handler

Embedded signing iframe

Copilot cloud agent

If your repo is set up for the Copilot cloud agent (the GitHub.com mode that opens its own PRs from an issue), the same .github/copilot-instructions.md file applies. Once the MCP and instructions are in place, an issue like “Add a Send Contract button to the customer detail page that sends a Firma signing request from template tmpl_abc123” will turn into a PR that wires up the env var, the backend handler, the webhook route, and the UI button without further hand-holding. Surface the webhook URL and template ID as TODOs in the PR description so the human reviewer can register the webhook in the Firma dashboard before merging.

Tips for working with Copilot + Firma

  • Be specific in prompts. “Use the Firma create-and-send endpoint” gets better results than “add e-signatures.” The Docs MCP server helps, but specific prompts still produce more accurate code.
  • Reference the docs explicitly. Starting a prompt with “Using the Firma docs” or “Check the Firma API documentation” tells Copilot to query the Docs MCP server before generating code.
  • Commit the instructions file first. The .github/copilot-instructions.md file only takes effect after it’s committed. Push it before asking Copilot to generate Firma code.
  • Test with real API calls. After generating your integration code, test it against the Firma API with a real template and signer email to confirm the generated code works end-to-end.

Next steps