meta-ads-mcp-python 1.0.79__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. meta_ads_mcp_python-1.0.79/PKG-INFO +187 -0
  2. meta_ads_mcp_python-1.0.79/README.md +160 -0
  3. meta_ads_mcp_python-1.0.79/pyproject.toml +84 -0
  4. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/__init__.py +79 -0
  5. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/__main__.py +10 -0
  6. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/__init__.py +55 -0
  7. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/accounts.py +141 -0
  8. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/ads.py +2751 -0
  9. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/ads_library.py +74 -0
  10. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/adsets.py +666 -0
  11. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/api.py +431 -0
  12. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/auth.py +567 -0
  13. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/authentication.py +207 -0
  14. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/budget_schedules.py +70 -0
  15. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/callback_server.py +256 -0
  16. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/campaigns.py +379 -0
  17. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/duplication.py +523 -0
  18. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/http_auth_integration.py +307 -0
  19. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/insights.py +161 -0
  20. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/mcc.py +232 -0
  21. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/openai_deep_research.py +418 -0
  22. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/pipeboard_auth.py +510 -0
  23. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/reports.py +135 -0
  24. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/resources.py +46 -0
  25. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/server.py +391 -0
  26. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/targeting.py +542 -0
  27. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/core/utils.py +225 -0
  28. meta_ads_mcp_python-1.0.79/src/meta_ads_mcp/settings.py +33 -0
@@ -0,0 +1,187 @@
1
+ Metadata-Version: 2.3
2
+ Name: meta-ads-mcp-python
3
+ Version: 1.0.79
4
+ Summary: MCP server for Meta Ads API -- manage campaigns, ad sets, ads, and Business Manager accounts
5
+ Keywords: meta,facebook,ads,api,mcp,claude
6
+ Author: Yves Junqueira
7
+ Author-email: Yves Junqueira <yves.junqueira@gmail.com>
8
+ License: BUSL-1.1
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: Other/Proprietary License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Requires-Dist: fastmcp>=2.0.0
15
+ Requires-Dist: loguru>=0.7.3
16
+ Requires-Dist: pydantic>=2.11.7
17
+ Requires-Dist: pydantic-settings>=2.10.1
18
+ Requires-Dist: httpx>=0.26.0
19
+ Requires-Dist: python-dotenv>=1.1.0
20
+ Requires-Dist: requests>=2.32.3
21
+ Requires-Dist: pillow>=10.0.0
22
+ Requires-Dist: python-dateutil>=2.8.2
23
+ Requires-Python: >=3.12
24
+ Project-URL: Homepage, https://github.com/locomotive-agency/meta-ads-mcp-python
25
+ Project-URL: Bug Tracker, https://github.com/locomotive-agency/meta-ads-mcp-python/issues
26
+ Description-Content-Type: text/markdown
27
+
28
+ # Meta Ads MCP
29
+
30
+ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for analysing Meta Ads campaigns through an AI interface. Retrieve performance data, visualize ad creatives, and surface insights for Facebook, Instagram, and other Meta platforms.
31
+
32
+ > **Read-only:** All tools are strictly read-only. No tool creates, modifies, or deletes any data.
33
+
34
+ > **Independent project:** This is an open-source project using Meta's public APIs. Not affiliated with or endorsed by Meta. For an officially approved Meta app, see [Pipeboard](https://pipeboard.co).
35
+
36
+ ---
37
+
38
+ ## Quick Start (Remote MCP)
39
+
40
+ The fastest way to get started is the [Pipeboard remote MCP](https://pipeboard.co) — no local setup required.
41
+
42
+ Remote MCP URL: `https://mcp.pipeboard.co/meta-ads-mcp`
43
+
44
+ With token auth: `https://mcp.pipeboard.co/meta-ads-mcp?token=YOUR_PIPEBOARD_TOKEN`
45
+
46
+ Get your token at [pipeboard.co/api-tokens](https://pipeboard.co/api-tokens).
47
+
48
+ ### Claude (Pro/Max)
49
+
50
+ 1. Go to [claude.ai/settings/integrations](https://claude.ai/settings/integrations)
51
+ 2. Click **Add Integration**, set the URL to `https://mcp.pipeboard.co/meta-ads-mcp`
52
+ 3. Click **Connect** and follow the prompts.
53
+
54
+ ### Cursor
55
+
56
+ Add to `~/.cursor/mcp.json`:
57
+
58
+ ```json
59
+ {
60
+ "mcpServers": {
61
+ "meta-ads-remote": {
62
+ "url": "https://mcp.pipeboard.co/meta-ads-mcp?token=YOUR_PIPEBOARD_TOKEN"
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ ### Other MCP Clients
69
+
70
+ Use the remote URL above. Full setup guides: [pipeboard.co](https://pipeboard.co)
71
+
72
+ ---
73
+
74
+ ## Local Installation
75
+
76
+ > For advanced users. The remote MCP is recommended for most cases.
77
+
78
+ **Requirements:** Python 3.12+, a Meta Developer App (App ID + Secret), and [uv](https://github.com/astral-sh/uv).
79
+
80
+ ```bash
81
+ pip install meta-ads-mcp
82
+ ```
83
+
84
+ ### Authentication
85
+
86
+ Copy `.env.example` to `.env` and set one of:
87
+
88
+ ```
89
+ PIPEBOARD_API_TOKEN=your_token # Recommended — no Meta app required
90
+ META_APP_ID=your_app_id # Direct Meta app credentials
91
+ META_APP_SECRET=your_app_secret
92
+ ```
93
+
94
+ ### Run
95
+
96
+ ```bash
97
+ meta-ads-mcp # stdio (default)
98
+ python -m meta_ads_mcp --transport streamable-http --host localhost --port 8080 # HTTP
99
+ ```
100
+
101
+ ### Claude Desktop config
102
+
103
+ ```json
104
+ {
105
+ "mcpServers": {
106
+ "meta-ads": {
107
+ "command": "meta-ads-mcp"
108
+ }
109
+ }
110
+ }
111
+ ```
112
+
113
+ ---
114
+
115
+ ## Configuration
116
+
117
+ | Variable | Description |
118
+ |---|---|
119
+ | `PIPEBOARD_API_TOKEN` | Pipeboard API token (recommended) |
120
+ | `META_APP_ID` | Meta Developer App ID (direct auth) |
121
+ | `META_APP_SECRET` | Meta Developer App Secret (direct auth) |
122
+ | `LOG_LEVEL` | `DEBUG`, `INFO`, `WARNING`, `ERROR` (default: `INFO`) |
123
+ | `SERVER_HOST` | HTTP transport host (default: `localhost`) |
124
+ | `SERVER_PORT` | HTTP transport port (default: `8080`) |
125
+
126
+ ---
127
+
128
+ ## Available Tools
129
+
130
+ | Tool | Description |
131
+ |---|---|
132
+ | `mcp_meta_ads_get_ad_accounts` | List accessible ad accounts |
133
+ | `mcp_meta_ads_get_account_info` | Get details for a specific ad account |
134
+ | `mcp_meta_ads_get_account_pages` | Get pages associated with an ad account |
135
+ | `mcp_meta_ads_get_campaigns` | List campaigns with optional status filter |
136
+ | `mcp_meta_ads_get_campaign_details` | Get details for a specific campaign |
137
+ | `mcp_meta_ads_get_adsets` | List ad sets, optionally filtered by campaign |
138
+ | `mcp_meta_ads_get_adset_details` | Get details for a specific ad set |
139
+ | `mcp_meta_ads_get_ads` | List ads, optionally filtered by campaign or ad set |
140
+ | `mcp_meta_ads_get_ad_details` | Get details for a specific ad |
141
+ | `mcp_meta_ads_get_ad_creatives` | Get creative details (text, images, URLs) |
142
+ | `mcp_meta_ads_get_ad_image` | Download and visualize an ad image |
143
+ | `mcp_meta_ads_get_insights` | Get performance metrics with attribution windows and breakdowns |
144
+ | `mcp_meta_ads_get_login_link` | Get a login link for Meta authentication |
145
+ | `mcp_meta_ads_search_interests` | Search interest targeting options by keyword |
146
+ | `mcp_meta_ads_get_interest_suggestions` | Get interest suggestions based on existing interests |
147
+ | `mcp_meta_ads_validate_interests` | Validate interest names or IDs |
148
+ | `mcp_meta_ads_search_behaviors` | List available behavior targeting options |
149
+ | `mcp_meta_ads_search_demographics` | List demographic targeting options |
150
+ | `mcp_meta_ads_search_geo_locations` | Search geographic targeting locations |
151
+ | `mcp_meta_ads_search` | Generic search across accounts, campaigns, ads, and pages |
152
+ | `mcp_meta_ads_get_businesses` | List all Business Manager accounts |
153
+ | `mcp_meta_ads_get_business_ad_accounts` | List ad accounts under a Business Manager |
154
+ | `mcp_meta_ads_find_client_account` | Search for a client account across Business Managers |
155
+ | `mcp_meta_ads_get_business_details` | Get details for a specific Business Manager |
156
+
157
+ ---
158
+
159
+ ## Troubleshooting
160
+
161
+ - **Auth errors:** Check your token/credentials in `.env`. Use `mcp_meta_ads_get_login_link` to re-authenticate.
162
+ - **No accounts returned:** Ensure the user has access to at least one ad account in Meta Business Manager.
163
+ - **Tool not found:** Confirm the server is running and your client config is correct.
164
+
165
+ ---
166
+
167
+ ## Privacy and Security
168
+
169
+ - Remote MCP: auth is handled in the cloud, no tokens stored locally.
170
+ - Local install: tokens are cached on your machine. Never commit your `.env` file.
171
+ - The server never exposes your access token to the LLM.
172
+
173
+ ---
174
+
175
+ ## Licensing
176
+
177
+ Licensed under the [Business Source License 1.1](LICENSE). Free for individual and business use. Converts to Apache 2.0 on January 1, 2029. You may not offer this as a competing hosted service.
178
+
179
+ For commercial licensing: [info@pipeboard.co](mailto:info@pipeboard.co)
180
+
181
+ ---
182
+
183
+ ## Support
184
+
185
+ - [Discord](https://discord.gg/YzMwQ8zrjr)
186
+ - [GitHub Issues](https://github.com/pipeboard-co/meta-ads-mcp/issues)
187
+ - [Email](mailto:info@pipeboard.co)
@@ -0,0 +1,160 @@
1
+ # Meta Ads MCP
2
+
3
+ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for analysing Meta Ads campaigns through an AI interface. Retrieve performance data, visualize ad creatives, and surface insights for Facebook, Instagram, and other Meta platforms.
4
+
5
+ > **Read-only:** All tools are strictly read-only. No tool creates, modifies, or deletes any data.
6
+
7
+ > **Independent project:** This is an open-source project using Meta's public APIs. Not affiliated with or endorsed by Meta. For an officially approved Meta app, see [Pipeboard](https://pipeboard.co).
8
+
9
+ ---
10
+
11
+ ## Quick Start (Remote MCP)
12
+
13
+ The fastest way to get started is the [Pipeboard remote MCP](https://pipeboard.co) — no local setup required.
14
+
15
+ Remote MCP URL: `https://mcp.pipeboard.co/meta-ads-mcp`
16
+
17
+ With token auth: `https://mcp.pipeboard.co/meta-ads-mcp?token=YOUR_PIPEBOARD_TOKEN`
18
+
19
+ Get your token at [pipeboard.co/api-tokens](https://pipeboard.co/api-tokens).
20
+
21
+ ### Claude (Pro/Max)
22
+
23
+ 1. Go to [claude.ai/settings/integrations](https://claude.ai/settings/integrations)
24
+ 2. Click **Add Integration**, set the URL to `https://mcp.pipeboard.co/meta-ads-mcp`
25
+ 3. Click **Connect** and follow the prompts.
26
+
27
+ ### Cursor
28
+
29
+ Add to `~/.cursor/mcp.json`:
30
+
31
+ ```json
32
+ {
33
+ "mcpServers": {
34
+ "meta-ads-remote": {
35
+ "url": "https://mcp.pipeboard.co/meta-ads-mcp?token=YOUR_PIPEBOARD_TOKEN"
36
+ }
37
+ }
38
+ }
39
+ ```
40
+
41
+ ### Other MCP Clients
42
+
43
+ Use the remote URL above. Full setup guides: [pipeboard.co](https://pipeboard.co)
44
+
45
+ ---
46
+
47
+ ## Local Installation
48
+
49
+ > For advanced users. The remote MCP is recommended for most cases.
50
+
51
+ **Requirements:** Python 3.12+, a Meta Developer App (App ID + Secret), and [uv](https://github.com/astral-sh/uv).
52
+
53
+ ```bash
54
+ pip install meta-ads-mcp
55
+ ```
56
+
57
+ ### Authentication
58
+
59
+ Copy `.env.example` to `.env` and set one of:
60
+
61
+ ```
62
+ PIPEBOARD_API_TOKEN=your_token # Recommended — no Meta app required
63
+ META_APP_ID=your_app_id # Direct Meta app credentials
64
+ META_APP_SECRET=your_app_secret
65
+ ```
66
+
67
+ ### Run
68
+
69
+ ```bash
70
+ meta-ads-mcp # stdio (default)
71
+ python -m meta_ads_mcp --transport streamable-http --host localhost --port 8080 # HTTP
72
+ ```
73
+
74
+ ### Claude Desktop config
75
+
76
+ ```json
77
+ {
78
+ "mcpServers": {
79
+ "meta-ads": {
80
+ "command": "meta-ads-mcp"
81
+ }
82
+ }
83
+ }
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Configuration
89
+
90
+ | Variable | Description |
91
+ |---|---|
92
+ | `PIPEBOARD_API_TOKEN` | Pipeboard API token (recommended) |
93
+ | `META_APP_ID` | Meta Developer App ID (direct auth) |
94
+ | `META_APP_SECRET` | Meta Developer App Secret (direct auth) |
95
+ | `LOG_LEVEL` | `DEBUG`, `INFO`, `WARNING`, `ERROR` (default: `INFO`) |
96
+ | `SERVER_HOST` | HTTP transport host (default: `localhost`) |
97
+ | `SERVER_PORT` | HTTP transport port (default: `8080`) |
98
+
99
+ ---
100
+
101
+ ## Available Tools
102
+
103
+ | Tool | Description |
104
+ |---|---|
105
+ | `mcp_meta_ads_get_ad_accounts` | List accessible ad accounts |
106
+ | `mcp_meta_ads_get_account_info` | Get details for a specific ad account |
107
+ | `mcp_meta_ads_get_account_pages` | Get pages associated with an ad account |
108
+ | `mcp_meta_ads_get_campaigns` | List campaigns with optional status filter |
109
+ | `mcp_meta_ads_get_campaign_details` | Get details for a specific campaign |
110
+ | `mcp_meta_ads_get_adsets` | List ad sets, optionally filtered by campaign |
111
+ | `mcp_meta_ads_get_adset_details` | Get details for a specific ad set |
112
+ | `mcp_meta_ads_get_ads` | List ads, optionally filtered by campaign or ad set |
113
+ | `mcp_meta_ads_get_ad_details` | Get details for a specific ad |
114
+ | `mcp_meta_ads_get_ad_creatives` | Get creative details (text, images, URLs) |
115
+ | `mcp_meta_ads_get_ad_image` | Download and visualize an ad image |
116
+ | `mcp_meta_ads_get_insights` | Get performance metrics with attribution windows and breakdowns |
117
+ | `mcp_meta_ads_get_login_link` | Get a login link for Meta authentication |
118
+ | `mcp_meta_ads_search_interests` | Search interest targeting options by keyword |
119
+ | `mcp_meta_ads_get_interest_suggestions` | Get interest suggestions based on existing interests |
120
+ | `mcp_meta_ads_validate_interests` | Validate interest names or IDs |
121
+ | `mcp_meta_ads_search_behaviors` | List available behavior targeting options |
122
+ | `mcp_meta_ads_search_demographics` | List demographic targeting options |
123
+ | `mcp_meta_ads_search_geo_locations` | Search geographic targeting locations |
124
+ | `mcp_meta_ads_search` | Generic search across accounts, campaigns, ads, and pages |
125
+ | `mcp_meta_ads_get_businesses` | List all Business Manager accounts |
126
+ | `mcp_meta_ads_get_business_ad_accounts` | List ad accounts under a Business Manager |
127
+ | `mcp_meta_ads_find_client_account` | Search for a client account across Business Managers |
128
+ | `mcp_meta_ads_get_business_details` | Get details for a specific Business Manager |
129
+
130
+ ---
131
+
132
+ ## Troubleshooting
133
+
134
+ - **Auth errors:** Check your token/credentials in `.env`. Use `mcp_meta_ads_get_login_link` to re-authenticate.
135
+ - **No accounts returned:** Ensure the user has access to at least one ad account in Meta Business Manager.
136
+ - **Tool not found:** Confirm the server is running and your client config is correct.
137
+
138
+ ---
139
+
140
+ ## Privacy and Security
141
+
142
+ - Remote MCP: auth is handled in the cloud, no tokens stored locally.
143
+ - Local install: tokens are cached on your machine. Never commit your `.env` file.
144
+ - The server never exposes your access token to the LLM.
145
+
146
+ ---
147
+
148
+ ## Licensing
149
+
150
+ Licensed under the [Business Source License 1.1](LICENSE). Free for individual and business use. Converts to Apache 2.0 on January 1, 2029. You may not offer this as a competing hosted service.
151
+
152
+ For commercial licensing: [info@pipeboard.co](mailto:info@pipeboard.co)
153
+
154
+ ---
155
+
156
+ ## Support
157
+
158
+ - [Discord](https://discord.gg/YzMwQ8zrjr)
159
+ - [GitHub Issues](https://github.com/pipeboard-co/meta-ads-mcp/issues)
160
+ - [Email](mailto:info@pipeboard.co)
@@ -0,0 +1,84 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.11.7,<0.12"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "meta-ads-mcp-python"
7
+ version = "1.0.79"
8
+ description = "MCP server for Meta Ads API -- manage campaigns, ad sets, ads, and Business Manager accounts"
9
+ authors = [{ name = "Yves Junqueira", email = "yves.junqueira@gmail.com" }]
10
+ license = { text = "BUSL-1.1" }
11
+ readme = "README.md"
12
+ keywords = ["meta", "facebook", "ads", "api", "mcp", "claude"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Intended Audience :: Developers",
16
+ "License :: Other/Proprietary License",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3.12",
19
+ ]
20
+ requires-python = ">= 3.12"
21
+ dependencies = [
22
+ "fastmcp>=2.0.0",
23
+ "loguru>=0.7.3",
24
+ "pydantic>=2.11.7",
25
+ "pydantic-settings>=2.10.1",
26
+ "httpx>=0.26.0",
27
+ "python-dotenv>=1.1.0",
28
+ "requests>=2.32.3",
29
+ "Pillow>=10.0.0",
30
+ "python-dateutil>=2.8.2",
31
+ ]
32
+
33
+ [dependency-groups]
34
+ dev = [
35
+ "mypy>=1.15.0",
36
+ "pre-commit>=4.1.0",
37
+ "pytest>=8.3.4",
38
+ "pytest-asyncio>=0.25.3",
39
+ "ruff>=0.9.7",
40
+ ]
41
+
42
+ [project.urls]
43
+ "Homepage" = "https://github.com/locomotive-agency/meta-ads-mcp-python"
44
+ "Bug Tracker" = "https://github.com/locomotive-agency/meta-ads-mcp-python/issues"
45
+
46
+ [project.scripts]
47
+ meta-ads-mcp = "meta_ads_mcp.core.server:main"
48
+
49
+ [tool.pytest.ini_options]
50
+ pythonpath = ["src"]
51
+ markers = [
52
+ "e2e: marks tests as end-to-end (requires running MCP server) - excluded from default runs",
53
+ ]
54
+ addopts = "-v --strict-markers -m 'not e2e'"
55
+ testpaths = ["tests"]
56
+ asyncio_mode = "auto"
57
+
58
+ [tool.ruff]
59
+ line-length = 88
60
+ src = ["src"]
61
+ output-format = "concise"
62
+
63
+ [tool.ruff.lint]
64
+ select = ["E", "F", "I", "C90", "B", "N", "D", "ANN", "TRY", "PD", "RUF200", "UP", "G"]
65
+ ignore = ["E501", "ANN003"]
66
+
67
+ [tool.ruff.lint.extend-per-file-ignores]
68
+ "__init__.py" = ["F401", "F403", "E402"]
69
+ "tests/**/*.py" = ["D", "ANN"]
70
+
71
+ [tool.ruff.lint.pydocstyle]
72
+ convention = "google"
73
+
74
+ [tool.ruff.lint.mccabe]
75
+ max-complexity = 6
76
+
77
+ [tool.mypy]
78
+ python_version = "3.12"
79
+ warn_return_any = true
80
+ warn_unused_configs = true
81
+ disallow_untyped_defs = true
82
+
83
+ [tool.uv.build-backend]
84
+ module-name = "meta_ads_mcp"
@@ -0,0 +1,79 @@
1
+ """
2
+ Meta Ads MCP - Python Package
3
+
4
+ This package provides a Meta Ads MCP integration
5
+ """
6
+
7
+ from meta_ads_mcp.core.server import main
8
+
9
+ __version__ = "1.0.79"
10
+
11
+ __all__ = [
12
+ 'get_ad_accounts',
13
+ 'get_account_info',
14
+ 'get_campaigns',
15
+ 'get_campaign_details',
16
+ 'create_campaign',
17
+ 'get_adsets',
18
+ 'get_adset_details',
19
+ 'update_adset',
20
+ 'get_ads',
21
+ 'get_ad_details',
22
+ 'get_ad_creatives',
23
+ 'get_ad_image',
24
+ 'update_ad',
25
+ 'get_insights',
26
+ # 'get_login_link' is conditionally exported via core.__all__
27
+ 'login_cli',
28
+ 'main',
29
+ 'search_interests',
30
+ 'get_interest_suggestions',
31
+ 'estimate_audience_size',
32
+ 'search_behaviors',
33
+ 'search_demographics',
34
+ 'search_geo_locations',
35
+ # MCC / Business Manager tools
36
+ 'get_businesses',
37
+ 'get_business_ad_accounts',
38
+ 'find_client_account',
39
+ 'get_business_details',
40
+ ]
41
+
42
+ # Import key functions to make them available at package level
43
+ from .core import (
44
+ get_ad_accounts,
45
+ get_account_info,
46
+ get_campaigns,
47
+ get_campaign_details,
48
+ create_campaign,
49
+ get_adsets,
50
+ get_adset_details,
51
+ update_adset,
52
+ get_ads,
53
+ get_ad_details,
54
+ get_ad_creatives,
55
+ get_ad_image,
56
+ update_ad,
57
+ get_insights,
58
+ login_cli,
59
+ main,
60
+ search_interests,
61
+ get_interest_suggestions,
62
+ estimate_audience_size,
63
+ search_behaviors,
64
+ search_demographics,
65
+ search_geo_locations,
66
+ # MCC / Business Manager tools
67
+ get_businesses,
68
+ get_business_ad_accounts,
69
+ find_client_account,
70
+ get_business_details,
71
+ )
72
+
73
+ # Define a main function to be used as a package entry point
74
+ def entrypoint():
75
+ """Main entry point for the package when invoked with uvx."""
76
+ return main()
77
+
78
+ # Re-export main for direct access
79
+ main = main
@@ -0,0 +1,10 @@
1
+ """
2
+ Meta Ads MCP - Main Entry Point
3
+
4
+ This module allows the package to be executed directly via `python -m meta_ads_mcp`
5
+ """
6
+
7
+ from meta_ads_mcp.core.server import main
8
+
9
+ if __name__ == "__main__":
10
+ main()
@@ -0,0 +1,55 @@
1
+ """Core functionality for Meta Ads API MCP package."""
2
+
3
+ from .server import mcp_server
4
+ from .accounts import get_ad_accounts, get_account_info
5
+ from .campaigns import get_campaigns, get_campaign_details
6
+ from .adsets import get_adsets, get_adset_details
7
+ from .ads import get_ads, get_ad_details, get_creative_details, get_ad_creatives, get_ad_image
8
+ from .insights import get_insights
9
+ from . import authentication # Import module to register conditional auth tools
10
+ from .server import login_cli, main
11
+ from .auth import login
12
+ from . import ads_library # Import module to register conditional tools
13
+ from .targeting import search_interests, get_interest_suggestions, estimate_audience_size, search_behaviors, search_demographics, search_geo_locations
14
+ from . import reports # Import module to register conditional tools
15
+ from . import duplication # Import module to register conditional duplication tools
16
+ from .openai_deep_research import search, fetch # OpenAI MCP Deep Research tools
17
+ from .mcc import ( # Business Manager (MCC) tools
18
+ get_businesses,
19
+ get_business_ad_accounts,
20
+ find_client_account,
21
+ get_business_details,
22
+ )
23
+
24
+ __all__ = [
25
+ 'mcp_server',
26
+ 'get_ad_accounts',
27
+ 'get_account_info',
28
+ 'get_campaigns',
29
+ 'get_campaign_details',
30
+ 'get_adsets',
31
+ 'get_adset_details',
32
+ 'get_ads',
33
+ 'get_ad_details',
34
+ 'get_creative_details',
35
+ 'get_ad_creatives',
36
+ 'get_ad_image',
37
+ 'get_insights',
38
+ # Note: 'get_login_link' is registered conditionally by the authentication module
39
+ 'login_cli',
40
+ 'login',
41
+ 'main',
42
+ 'search_interests',
43
+ 'get_interest_suggestions',
44
+ 'estimate_audience_size',
45
+ 'search_behaviors',
46
+ 'search_demographics',
47
+ 'search_geo_locations',
48
+ 'search', # OpenAI MCP Deep Research search tool
49
+ 'fetch', # OpenAI MCP Deep Research fetch tool
50
+ # MCC / Business Manager tools
51
+ 'get_businesses',
52
+ 'get_business_ad_accounts',
53
+ 'find_client_account',
54
+ 'get_business_details',
55
+ ]