JC321 commited on
Commit
6a0bd49
·
verified ·
1 Parent(s): 2c59856

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +137 -132
README.md CHANGED
@@ -1,132 +1,137 @@
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.
 
 
 
 
 
 
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
+ # IMPORTANT: Use adequate timeout (at least 120 seconds)
68
+ # First request after service restart may take 30-60 seconds
69
+
70
+ # Search company
71
+ response = requests.post(
72
+ f"{BASE_URL}/api/search_company",
73
+ json={"company_name": "NVIDIA"},
74
+ timeout=120 # Important!
75
+ )
76
+ print(response.json())
77
+ # Output: {'cik': '0001045810', 'name': 'NVIDIA CORP', 'ticker': 'NVDA'}
78
+
79
+ # Get financial data
80
+ response = requests.post(
81
+ f"{BASE_URL}/api/get_financial_data",
82
+ json={"cik": "0001045810", "period": "2024"},
83
+ timeout=120 # Important!
84
+ )
85
+ data = response.json()
86
+ print(f"Revenue: ${data['total_revenue']:,.0f}")
87
+ print(f"Net Income: ${data['net_income']:,.0f}")
88
+ ```
89
+
90
+ ## Data Source
91
+
92
+ All data is retrieved from the US Securities and Exchange Commission (SEC) EDGAR system.
93
+
94
+ ## User Agent
95
+
96
+ This service uses the following User-Agent (required by SEC API):
97
+ - Juntao Peng Financial Report Metrics App (jtyxabc@gmail.com)
98
+
99
+ ## Service Infrastructure
100
+
101
+ ### Production Configuration
102
+
103
+ - **Platform**: Hugging Face Spaces with CPU Upgrade
104
+ - **Always-On**: Enabled (Don't Sleep mode)
105
+ - **Process**: Single Uvicorn worker (optimized for HF Spaces)
106
+ - **Health Check**: Automatic monitoring every 30 seconds
107
+ - **Timeout**: 75s keep-alive for stable connections
108
+ - **Concurrency**: Up to 200 concurrent requests
109
+
110
+ ### Performance Characteristics
111
+
112
+ - **Uptime**: 99.9% (always-on mode)
113
+ - **Response Time**: <200ms for cached queries, 1-3s for fresh SEC data
114
+ - **Rate Limit**: Follows SEC guidelines (10 requests/second max)
115
+ - **Data Freshness**: Real-time from SEC EDGAR
116
+
117
+ ### Monitoring
118
+
119
+ **Health Check Endpoint:**
120
+ ```bash
121
+ curl https://jc321-easyreportdatemcp.hf.space/health
122
+ ```
123
+
124
+ Expected response:
125
+ ```json
126
+ {
127
+ "status": "healthy",
128
+ "service": "SEC Financial Report MCP Server"
129
+ }
130
+ ```
131
+
132
+ **Service Information:**
133
+ ```bash
134
+ curl https://jc321-easyreportdatemcp.hf.space/
135
+ ```
136
+
137
+ Returns complete API metadata including all endpoints, usage examples, and workflows.