# Turning SEC Filings into AI Fuel: Inside Moedim.Edgar’s MCP-Powered Gateway to EDGAR

If you’ve ever tried to build an AI system that reasons about public companies, you’ve probably run into the same brick wall: the SEC’s EDGAR database. It’s a goldmine of corporate disclosures, yet it feels like it was designed for humans with patience, not machines with tokens.

[**Moedim.Edgar**](https://github.com/kdcllc/Moedim.Edgar) steps directly into that gap. It’s a modern C#/.NET library—and a companion MCP server—that turns raw EDGAR APIs into type-safe, async-friendly building blocks for AI agents and financial applications.

In other words: this repo ([`https://github.com/kdcllc/Moedim.Edgar`](https://github.com/kdcllc/Moedim.Edgar)) is about turning SEC filings into *AI-ready context*.

---

## **From Legacy Feeds to AI-Native Infrastructure**

At its core, `[Moedim.Edgar](`[`https://github.com/kdcllc/Moedim.Edgar`](https://github.com/kdcllc/Moedim.Edgar)`)` is a .NET 8 library that wraps the SEC EDGAR APIs with:

* A modern `IHttpClientFactory`\-based HTTP client
    
* Strongly-typed C# models for EDGAR data structures
    
* Full async/await support
    
* Dependency injection extensions via `Microsoft.Extensions.DependencyInjection`
    
* Configurable options via a clean options pattern
    

The goal is not just “yet another HTTP wrapper,” but a library that feels native in contemporary .NET backends and can be dropped into real systems: microservices, data pipelines, and—most interestingly—AI assistants.

The project structure reflects that intent:

* [**Moedim.Edgar**](https://github.com/kdcllc/Moedim.Edgar) – the core EDGAR client: services, models, query types.
    
* **Moedim.Edgar.Sample** – a comprehensive sample app walking through all main services.
    
* **Moedim.Edgar.Mcp** – an MCP server that exposes EDGAR as tools for AI agents.
    

That last project is where things shift from “API client” to “AI infrastructure.”

---

## **Why EDGAR Matters for AI**

If you’re building AI for:

* Equity research
    
* Corporate credit analysis
    
* Competitive intel
    
* Regulatory/compliance workflows
    

…you quickly realize you need structured, reliable access to:

* Company facts (revenues, assets, liabilities, etc.)
    
* Specific financial concepts over time
    
* Filings history and search by form types (10-K, 10-Q, 8-K, etc.)
    
* Latest filings for monitoring and alerts
    
* Filing-level details and document structures
    

[Moedim.Edgar](https://github.com/kdcllc/Moedim.Edgar)’s models and services map almost exactly onto this mental model:

* **Company Lookup** – resolve companies to CIKs and metadata.
    
* **Company Facts** – explore the full universe of reported facts.
    
* **Company Concept** – zoom in on a specific metric (e.g. revenue).
    
* **Edgar Search** – discovery of filings with flexible queries.
    
* **Latest Filings** – what just hit the tape.
    
* **Filing Details** – drill into specific submissions.
    

The sample application ships as a guided tour: configuration, service usage, pagination, error handling, and output examples. It’s less a “hello world” and more a “here’s how you’d actually wire this into a research workflow.”

---

## **MCP: Giving AI Agents First-Class Access to EDGAR**

The most forward-looking part of the repo is **Moedim.Edgar.Mcp**, an implementation of a Model Context Protocol server that exposes EDGAR as a toolset to AI assistants.

Instead of having your AI agent hallucinate SEC data or rely on brittle scraping, you define *tools* that:

* Look up companies
    
* Pull company facts
    
* Fetch concept-specific timeseries
    
* Search filings
    
* Retrieve filing details
    

The MCP server is built on:

* The **ModelContextProtocol** C# SDK
    
* The [**Moedim.Edgar**](https://github.com/kdcllc/Moedim.Edgar) library itself
    
* The .NET Generic Host ([`Microsoft.Extensions.Hosting`](http://Microsoft.Extensions.Hosting))
    

The documentation calls out:

* **Self-contained binaries** for Windows, macOS, and Linux (no runtime required).
    
* Targeting **.NET 10 SDK** for development, but compiled into cross-platform, self-contained applications.
    
* A structured [**TOOLS.md**](http://TOOLS.md) describing 13 tools grouped by domain:
    
    * Company data tools
        
    * Filing search tools
        
    * Filing details tools
        
    * Configuration and usage examples
        
    * Common financial concepts and SEC forms
        

This is exactly the kind of pattern we’re seeing emerge across AI ecosystems: instead of “prompting the model to Google things,” you grant the model a *well-documented, typed interface* to critical data systems, and let it reason on top.

[Moedim.Edgar](https://github.com/kdcllc/Moedim.Edgar).Mcp is that interface for EDGAR.

---

## **Design Choices That Matter to AI Builders**

Several technical choices in this repo are particularly relevant if you’re building AI-infused systems:

1. **Type-Safe Financial Models**
    
    By encoding EDGAR concepts in strongly-typed C# models, you get:
    
    * Safer transformations into embeddings, feature vectors, or RAG documents.
        
    * Less room for silent shape mismatches when serializing/deserializing data for AI pipelines.
        
    * Clearer documentation and discoverable APIs directly from IDE tooling.
        
2. **Async-First API Surface**
    
    Fetching EDGAR data is inherently I/O-bound and often pagination-heavy. Full async support throughout means:
    
    * You can build high-throughput ingestion services.
        
    * Agents can concurrently fetch multiple companies or filings without blocking threads.
        
    * You’re well-positioned to scale in cloud-native environments.
        
3. **Dependency Injection as a First-Class Citizen**
    
    Support for `Microsoft.Extensions.DependencyInjection` makes the EDGAR client feel like any other infrastructure dependency:
    
    * Register the client and services once.
        
    * Inject into orchestrators, background workers, or tool handlers.
        
    * Swap or wrap services for testing or extended logic.
        
    
    This is especially key when bridging between a host (e.g., an MCP server or orchestration engine) and the low-level EDGAR API.
    
4. **Configuration via Options**
    
    `SecEdgarOptions` centralizes configuration—user agent, rate limiting behavior, base URLs, etc.—so that:
    
    * You can tune behavior per environment.
        
    * You can plug in secrets/configuration providers for regulated deployments.
        
    * You can adapt when the SEC inevitably adjusts its API boundaries.
        

---

## **A Path to AI-Native Financial Research**

Taken together, [Moedim.Edgar](https://github.com/kdcllc/Moedim.Edgar) and [Moedim.Edgar](https://github.com/kdcllc/Moedim.Edgar).Mcp offer a compelling blueprint for turning a legacy data source into something AI-native:

1. **Normalize the data source** with a robust, typed client library.
    
2. **Provide a guided sample** that demonstrates real-world usage patterns and edge cases.
    
3. **Expose an AI-friendly protocol layer** (MCP) that lets assistants call into that library safely and reliably.
    
4. **Ship cross-platform binaries** so teams can run the AI data services anywhere—locally, in containers, or on hosted environments.
    

This is a pattern that can be replicated for:

* Other regulators (e.g., ESMA, FCA, local securities commissions)
    
* Alternative data sources (shipping, satellite, ESG, credit)
    
* Internal enterprise systems (ERP, CRM, risk engines)
    

[Moedim.Edgar](https://github.com/kdcllc/Moedim.Edgar) just happens to tackle one of the most foundational public datasets in finance.

---

## **Why This Matters Now**

As LLM-based copilots move from “answering questions” to **powering workflows**, they need deep, structured, and reliable access to domain data. For financial workflows, EDGAR is table stakes.

Projects like [Moedim.Edgar](https://github.com/kdcllc/Moedim.Edgar) show how you can:

* Respect the underlying API and its constraints.
    
* Wrap it in a developer-friendly, cloud-native .NET library.
    
* Then layer on an AI-native protocol (MCP) that lets assistants plug directly into the data without brittle scraping or ad-hoc glue code.
    

If you’re building AI systems that touch public companies, this repo is less a “nice utility” and more a **reference architecture** for how to turn a legacy data source into a first-class AI tool.

And if nothing else, it’s a reminder that sometimes the most impactful AI work isn’t in training bigger models—it’s in making the *right data* reliably available to the models we already have.
