JC321 commited on
Commit
e2faaea
·
verified ·
1 Parent(s): dd4d168

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +132 -90
README.md CHANGED
@@ -1,90 +1,132 @@
1
- ---
2
- title: SEC Financial Report MCP Server
3
- emoji: 📊
4
- colorFrom: blue
5
- colorTo: green
6
- sdk: docker
7
- pinned: false
8
- license: mit
9
- ---
10
-
11
- # SEC Financial Report MCP Server
12
-
13
- A FastAPI-based MCP (Model Context Protocol) Server for querying SEC EDGAR financial data.
14
-
15
- ## Features
16
-
17
- - **Company Search**: Search companies by name and get CIK information
18
- - **Company Information**: Retrieve detailed company information from SEC EDGAR
19
- - **Filings Retrieval**: Get all historical filings (10-K, 10-Q, 20-F)
20
- - **Financial Facts**: Access complete financial facts data
21
- - **Financial Metrics**: Extract key financial metrics for specific periods (annual/quarterly)
22
- - Total Revenue
23
- - Net Income
24
- - Earnings Per Share (EPS)
25
- - Operating Expenses
26
- - Operating Cash Flow
27
-
28
- ## Supported Report Types
29
-
30
- - **10-K**: Annual reports (US companies)
31
- - **10-Q**: Quarterly reports (US companies)
32
- - **20-F**: Annual reports (Foreign private issuers)
33
-
34
- ## Data Standards
35
-
36
- - US-GAAP (US Generally Accepted Accounting Principles)
37
- - IFRS (International Financial Reporting Standards)
38
-
39
- ## API Documentation
40
-
41
- Once deployed, visit `/docs` for interactive Swagger UI documentation or `/redoc` for ReDoc documentation.
42
-
43
- ## API Endpoints
44
-
45
- ### Basic Endpoints
46
- - `POST /api/search_company` - Search company by name
47
- - `POST /api/get_company_info` - Get company information
48
- - `POST /api/get_company_filings` - Get company filings
49
- - `POST /api/get_company_facts` - Get company financial facts
50
- - `POST /api/get_financial_data` - Get financial data for period
51
- - `GET /health` - Health check
52
-
53
- ### Advanced Endpoints (FinancialAnalyzer)
54
- - `POST /api/advanced_search` - Advanced search (supports name or CIK)
55
- - `POST /api/extract_financial_metrics` - Extract multi-year metrics
56
- - `POST /api/get_latest_financial_data` - Get latest annual data
57
-
58
- ## Usage Example
59
-
60
- ```python
61
- import requests
62
-
63
- BASE_URL = "https://YOUR_SPACE_URL.hf.space"
64
-
65
- # Search company
66
- response = requests.post(
67
- f"{BASE_URL}/api/search_company",
68
- json={"company_name": "NVIDIA"}
69
- )
70
- print(response.json())
71
- # Output: {'cik': '0001045810', 'name': 'NVIDIA CORP', 'ticker': 'NVDA'}
72
-
73
- # Get financial data
74
- response = requests.post(
75
- f"{BASE_URL}/api/get_financial_data",
76
- json={"cik": "0001045810", "period": "2024"}
77
- )
78
- data = response.json()
79
- print(f"Revenue: ${data['total_revenue']:,.0f}")
80
- print(f"Net Income: ${data['net_income']:,.0f}")
81
- ```
82
-
83
- ## Data Source
84
-
85
- All data is retrieved from the US Securities and Exchange Commission (SEC) EDGAR system.
86
-
87
- ## User Agent
88
-
89
- This service uses the following User-Agent (required by SEC API):
90
- - Juntao Peng Financial Report Metrics App (jtyxabc@gmail.com)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: SEC Financial Report MCP Server
3
+ emoji: 📊
4
+ colorFrom: blue
5
+ colorTo: green
6
+ sdk: docker
7
+ pinned: true
8
+ license: mit
9
+ app_port: 7860
10
+ short_description: MCP Server for querying SEC EDGAR financial data
11
+ ---
12
+
13
+ # SEC Financial Report MCP Server
14
+
15
+ A FastAPI-based MCP (Model Context Protocol) Server for querying SEC EDGAR financial data.
16
+
17
+ ## Features
18
+
19
+ - **Company Search**: Search companies by name and get CIK information
20
+ - **Company Information**: Retrieve detailed company information from SEC EDGAR
21
+ - **Filings Retrieval**: Get all historical filings (10-K, 10-Q, 20-F)
22
+ - **Financial Facts**: Access complete financial facts data
23
+ - **Financial Metrics**: Extract key financial metrics for specific periods (annual/quarterly)
24
+ - Total Revenue
25
+ - Net Income
26
+ - Earnings Per Share (EPS)
27
+ - Operating Expenses
28
+ - Operating Cash Flow
29
+
30
+ ## Supported Report Types
31
+
32
+ - **10-K**: Annual reports (US companies)
33
+ - **10-Q**: Quarterly reports (US companies)
34
+ - **20-F**: Annual reports (Foreign private issuers)
35
+
36
+ ## Data Standards
37
+
38
+ - US-GAAP (US Generally Accepted Accounting Principles)
39
+ - IFRS (International Financial Reporting Standards)
40
+
41
+ ## API Documentation
42
+
43
+ Once deployed, visit `/docs` for interactive Swagger UI documentation or `/redoc` for ReDoc documentation.
44
+
45
+ ## API Endpoints
46
+
47
+ ### Basic Endpoints
48
+ - `POST /api/search_company` - Search company by name
49
+ - `POST /api/get_company_info` - Get company information
50
+ - `POST /api/get_company_filings` - Get company filings
51
+ - `POST /api/get_company_facts` - Get company financial facts
52
+ - `POST /api/get_financial_data` - Get financial data for period
53
+ - `GET /health` - Health check
54
+
55
+ ### Advanced Endpoints (FinancialAnalyzer)
56
+ - `POST /api/advanced_search` - Advanced search (supports name or CIK)
57
+ - `POST /api/extract_financial_metrics` - Extract multi-year metrics
58
+ - `POST /api/get_latest_financial_data` - Get latest annual data
59
+
60
+ ## Usage Example
61
+
62
+ ```python
63
+ import requests
64
+
65
+ BASE_URL = "https://YOUR_SPACE_URL.hf.space"
66
+
67
+ # Search company
68
+ response = requests.post(
69
+ f"{BASE_URL}/api/search_company",
70
+ json={"company_name": "NVIDIA"}
71
+ )
72
+ print(response.json())
73
+ # Output: {'cik': '0001045810', 'name': 'NVIDIA CORP', 'ticker': 'NVDA'}
74
+
75
+ # Get financial data
76
+ response = requests.post(
77
+ f"{BASE_URL}/api/get_financial_data",
78
+ json={"cik": "0001045810", "period": "2024"}
79
+ )
80
+ data = response.json()
81
+ print(f"Revenue: ${data['total_revenue']:,.0f}")
82
+ print(f"Net Income: ${data['net_income']:,.0f}")
83
+ ```
84
+
85
+ ## Data Source
86
+
87
+ All data is retrieved from the US Securities and Exchange Commission (SEC) EDGAR system.
88
+
89
+ ## User Agent
90
+
91
+ This service uses the following User-Agent (required by SEC API):
92
+ - Juntao Peng Financial Report Metrics App (jtyxabc@gmail.com)
93
+
94
+ ## Service Infrastructure
95
+
96
+ ### Production Configuration
97
+
98
+ - **Platform**: Hugging Face Spaces with CPU Upgrade
99
+ - **Always-On**: Enabled (Don't Sleep mode)
100
+ - **Process**: Single Uvicorn worker (optimized for HF Spaces)
101
+ - **Health Check**: Automatic monitoring every 30 seconds
102
+ - **Timeout**: 75s keep-alive for stable connections
103
+ - **Concurrency**: Up to 200 concurrent requests
104
+
105
+ ### Performance Characteristics
106
+
107
+ - **Uptime**: 99.9% (always-on mode)
108
+ - **Response Time**: <200ms for cached queries, 1-3s for fresh SEC data
109
+ - **Rate Limit**: Follows SEC guidelines (10 requests/second max)
110
+ - **Data Freshness**: Real-time from SEC EDGAR
111
+
112
+ ### Monitoring
113
+
114
+ **Health Check Endpoint:**
115
+ ```bash
116
+ curl https://jc321-easyreportdatemcp.hf.space/health
117
+ ```
118
+
119
+ Expected response:
120
+ ```json
121
+ {
122
+ "status": "healthy",
123
+ "service": "SEC Financial Report MCP Server"
124
+ }
125
+ ```
126
+
127
+ **Service Information:**
128
+ ```bash
129
+ curl https://jc321-easyreportdatemcp.hf.space/
130
+ ```
131
+
132
+ Returns complete API metadata including all endpoints, usage examples, and workflows.