ib-mcp copilot-instructions.md

ib-mcp copilot-instructions.md is an instructions file for GitHub Copilot from Hellek1/ib-mcp. It costs 1,423 tokens per session, scanned A, original, BSD-3-Clause.

Repository instructions for an MCP server that gives AI applications read-only access to Interactive Brokers account and market data. Interactive Brokers is a brokerage platform, and MCP is a standard way for AI applications to use external tools.

In plain words
What is it for?
Use them when changing the Python server, its FastMCP tools, Interactive Brokers connection, contract lookup, market data, news, fundamentals, portfolio, or account information.
Why use it?
They keep the server’s architecture and safety boundary clear, helping agents avoid adding unintended write operations or breaking its asynchronous connection and tool-registration patterns.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/hellek1/ib-mcp/copilot-instructions
Clone the repo
git clone --depth 1 https://github.com/Hellek1/ib-mcp

Made for: GitHub Copilot.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ib-mcp copilot-instructions.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/hellek1/ib-mcp/copilot-instructions.svg)](https://agentmods.dev/instructions/hellek1/ib-mcp/copilot-instructions)
Your own site
<a href="https://agentmods.dev/instructions/hellek1/ib-mcp/copilot-instructions"><img src="https://agentmods.dev/badge/instructions/hellek1/ib-mcp/copilot-instructions.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,423 This file is loaded in full into every session.
When invoked 1,423 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01423 $0.01423
Opus 5 $0.00711 $0.00711
Sonnet 5 $0.00285 $0.00285
Haiku 4.5 $0.00142 $0.00142

Measured 5d ago against content hash 3d93f1aa79b5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ib-mcp copilot-instructions.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/copilot-instructions.md · 189 lines

How it starts

The opening of the file, as written. The whole thing — 189 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Copilot Instructions for IB-MCP

This repository contains an Interactive Brokers MCP (Model Context Protocol) server that provides read-only access to Interactive Brokers data via the async ib_async library and FastMCP framework.

Project Overview

Purpose: Expose Interactive Brokers financial data to LLM applications and autonomous agents through the MCP protocol, maintaining read-only access for safety.

Key Technologies:

  • Python 3.12+ (modern Python features expected)
  • FastMCP framework for MCP protocol implementation
  • ib_async for Interactive Brokers API integration
  • Poetry for dependency management
  • Async/await patterns throughout

Architecture

Core Components

  • ib_mcp/server.py: Main MCP server implementation using FastMCP
  • IBMCPServer: Primary server class that manages IB connection and tool registration
  • Tools: Contract lookup, market data, news, fundamentals, portfolio/account info

MCP Tools Pattern

Tools are registered using FastMCP decorators within _register_handlers() method:

@self.server.tool
async def tool_name(
    param: Annotated[str, Field(description="Parameter description")]
) -> str:
    await _ensure_connected()
    # Tool implementation
    return "human-readable result string"

Coding Standards & Conventions

Python Standards

  • Python Version: 3.12+ required, use modern syntax (list[T], dict[K,V] over typing equivalents)
  • Type Hints: Required for all public functions, prefer built-in generics
  • Async/Await: All IB API calls must be async, use await self.ib.someMethodAsync()
  • Error Handling: Catch broad exceptions only at integration boundaries, re-raise with context

Code Style

  • Formatter: Ruff (handles both imports and formatting)
  • Line Length: 100 characters
  • Quotes: Double quotes preferred
  • Import Order: Managed by Ruff

Project Conventions

  • Tool Returns: Always return plain strings, prefer human-readable tables/bullet lists
  • Parameter Docs: Use Annotated[Type, Field(description="...")] for tool parameters
  • Connection Management: Use _ensure_connected() before IB API calls
  • XML Processing: Convert XML responses to Markdown for better LLM readability

Read the full file on GitHub · 189 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 189 lines · 1,423 tokens per session scan A 3d93f1aa79b5

Subscribe to this mod's changes

ib-mcp copilot-instructions.md is an instructions file published in the GitHub repository Hellek1/ib-mcp (17 stars, last pushed 29d ago), licensed BSD-3-Clause. It adds 1,423 tokens to every session, about $0.0071 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories