Skip to content

Commit 6b28408

Browse files
revert: undo accidental inclusion of non-doc changes in 60eedce
Commit 60eedce was meant to only remove the hero image from introduction.mdx, but accidentally included changes to: - pyproject.toml - sec_edgar_mcp/core/client.py - sec_edgar_mcp/server.py - sec_edgar_mcp/tools/filings.py This commit restores those files to their state before 60eedce, keeping only the intended documentation change.
1 parent 6cd52a8 commit 6b28408

File tree

4 files changed

+12
-28
lines changed

4 files changed

+12
-28
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ classifiers = [
1515
"License :: OSI Approved :: GNU Affero General Public License v3",
1616
"Operating System :: OS Independent",
1717
]
18-
dependencies = ["mcp[cli]>=1.7.1", "sec-edgar-toolkit>=0.1.0", "requests>=2.31.0"]
18+
dependencies = ["mcp[cli]>=1.7.1", "edgartools>=4.4.0", "requests>=2.31.0"]
1919

2020
[tool.setuptools.packages.find]
2121
where = ["."]

sec_edgar_mcp/core/client.py

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,20 @@
11
from typing import Optional
2-
from sec_edgar_toolkit.core.global_functions import set_identity, find_company, search
3-
from sec_edgar_toolkit import Company as SECCompany
2+
from edgar import Company, set_identity, find_company, search
43
from ..utils.cache import TickerCache
54
from ..utils.exceptions import CompanyNotFoundError
65
from ..config import initialize_config
7-
from .filing_wrapper import wrap_filings
8-
9-
10-
class Company(SECCompany):
11-
"""Extended Company class with additional methods."""
12-
13-
def get_filings(self, form=None, **kwargs):
14-
"""Get filings with .latest() support."""
15-
filings = super().get_filings(form=form, **kwargs)
16-
return wrap_filings(filings)
17-
18-
def get_facts(self):
19-
"""Compatibility wrapper for get_company_facts."""
20-
# sec-edgar-toolkit uses get_company_facts instead of get_facts
21-
if hasattr(self, "get_company_facts"):
22-
return self.get_company_facts()
23-
# Fallback to original if it exists
24-
return super().get_facts() if hasattr(super(), "get_facts") else None
6+
import edgar
257

268

279
class EdgarClient:
28-
"""Wrapper around sec-edgar-toolkit for consistent API access."""
10+
"""Wrapper around edgar-tools for consistent API access."""
2911

3012
def __init__(self):
3113
self._user_agent = initialize_config()
32-
# Set identity for sec-edgar-toolkit
14+
# Set identity for edgar-tools
3315
set_identity(self._user_agent)
16+
# Also set the default user agent
17+
edgar.set_identity(self._user_agent)
3418
self._ticker_cache = TickerCache(self._user_agent)
3519

3620
def get_company(self, identifier: str) -> Company:
@@ -67,7 +51,7 @@ def get_cik_by_ticker(self, ticker: str) -> Optional[str]:
6751
def search_companies(self, query: str, limit: int = 10) -> list:
6852
"""Search for companies by name."""
6953
try:
70-
# Use sec-edgar-toolkit search functionality
54+
# Use edgar-tools search functionality
7155
results = search(query)
7256

7357
# Convert to list format and limit results

sec_edgar_mcp/server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Suppress INFO logs from edgar library
77
logging.getLogger("edgar").setLevel(logging.WARNING)
88

9+
910
# Add system-wide instructions for deterministic responses
1011
DETERMINISTIC_INSTRUCTIONS = """
1112
CRITICAL: When responding to SEC filing data requests, you MUST follow these rules:

sec_edgar_mcp/tools/filings.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
from typing import Dict, Union, List, Optional, Any
22
from datetime import datetime
3-
from sec_edgar_toolkit.core.global_functions import get_filings as sec_get_filings
3+
from edgar import get_filings
44
from ..core.client import EdgarClient
5-
from ..core.filing_wrapper import wrap_filings
65
from ..core.models import FilingInfo
76
from ..utils.exceptions import FilingNotFoundError
87
from .types import ToolResponse
@@ -28,8 +27,8 @@ def get_recent_filings(
2827
company = self.client.get_company(identifier)
2928
filings = company.get_filings(form=form_type)
3029
else:
31-
# Global filings using sec-edgar-toolkit get_filings()
32-
filings = wrap_filings(sec_get_filings(form=form_type, limit=limit))
30+
# Global filings using edgar-tools get_filings()
31+
filings = get_filings(form=form_type, count=limit)
3332

3433
# Limit results
3534
filings_list = []

0 commit comments

Comments
 (0)