meta-ads-mcp 0.3.0__tar.gz → 0.3.1__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.
- meta_ads_mcp-0.3.1/Dockerfile +25 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/PKG-INFO +2 -2
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/__init__.py +1 -1
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/api.py +2 -2
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/api.py +1 -1
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/auth.py +2 -2
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/pipeboard_auth.py +1 -1
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/pyproject.toml +2 -2
- meta_ads_mcp-0.3.1/smithery.yaml +33 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/test_pipeboard_auth.py +1 -1
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/.gitignore +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/LICENSE +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/META_API_NOTES.md +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/README.md +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/debug_meta_api_tool.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/debug_token_flow.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/future_improvements.md +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/images/meta-ads-example.png +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta-ads-mcp +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_auth.sh +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/__main__.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/__init__.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/accounts.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/ads.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/adsets.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/authentication.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/callback_server.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/campaigns.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/insights.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/resources.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/server.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_ads_mcp/core/utils.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/meta_auth_test.sh +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/requirements.txt +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/setup.py +0 -0
- {meta_ads_mcp-0.3.0 → meta_ads_mcp-0.3.1}/test_meta_ads_auth.py +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
FROM python:3.11-slim
|
|
2
|
+
|
|
3
|
+
# Install system dependencies
|
|
4
|
+
RUN apt-get update && \
|
|
5
|
+
apt-get install -y --no-install-recommends gcc && \
|
|
6
|
+
rm -rf /var/lib/apt/lists/*
|
|
7
|
+
|
|
8
|
+
# Set working directory
|
|
9
|
+
WORKDIR /app
|
|
10
|
+
|
|
11
|
+
# Install uv
|
|
12
|
+
RUN pip install --upgrade pip && \
|
|
13
|
+
pip install uv
|
|
14
|
+
|
|
15
|
+
# Copy requirements file
|
|
16
|
+
COPY requirements.txt .
|
|
17
|
+
|
|
18
|
+
# Install dependencies using uv
|
|
19
|
+
RUN uv pip install -r requirements.txt
|
|
20
|
+
|
|
21
|
+
# Copy the rest of the application
|
|
22
|
+
COPY . .
|
|
23
|
+
|
|
24
|
+
# Command to run the Meta Ads MCP server
|
|
25
|
+
CMD ["python", "-m", "meta_ads_mcp"]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: meta-ads-mcp
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Model Calling Protocol (MCP) plugin for interacting with Meta Ads API
|
|
5
5
|
Project-URL: Homepage, https://github.com/nictuku/meta-ads-mcp
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/nictuku/meta-ads-mcp/issues
|
|
7
|
-
Author-email:
|
|
7
|
+
Author-email: Yves Junqueira <yves.junqueira@gmail.com>
|
|
8
8
|
License: MIT
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Keywords: ads,api,claude,facebook,mcp,meta
|
|
@@ -22,7 +22,7 @@ from http.server import HTTPServer, BaseHTTPRequestHandler
|
|
|
22
22
|
mcp_server = FastMCP("meta-ads-generated", use_consistent_tool_format=True)
|
|
23
23
|
|
|
24
24
|
# Constants
|
|
25
|
-
META_GRAPH_API_VERSION = "
|
|
25
|
+
META_GRAPH_API_VERSION = "v22.0"
|
|
26
26
|
META_GRAPH_API_BASE = f"https://graph.facebook.com/{META_GRAPH_API_VERSION}"
|
|
27
27
|
USER_AGENT = "meta-ads-mcp/1.0"
|
|
28
28
|
|
|
@@ -253,7 +253,7 @@ class AuthManager:
|
|
|
253
253
|
def get_auth_url(self) -> str:
|
|
254
254
|
"""Generate the Facebook OAuth URL for desktop app flow"""
|
|
255
255
|
return (
|
|
256
|
-
f"https://www.facebook.com/
|
|
256
|
+
f"https://www.facebook.com/v22.0/dialog/oauth?"
|
|
257
257
|
f"client_id={self.app_id}&"
|
|
258
258
|
f"redirect_uri={self.redirect_uri}&"
|
|
259
259
|
f"scope={AUTH_SCOPE}&"
|
|
@@ -10,7 +10,7 @@ from .auth import needs_authentication, get_current_access_token, auth_manager,
|
|
|
10
10
|
from .utils import logger
|
|
11
11
|
|
|
12
12
|
# Constants
|
|
13
|
-
META_GRAPH_API_VERSION = "
|
|
13
|
+
META_GRAPH_API_VERSION = "v22.0"
|
|
14
14
|
META_GRAPH_API_BASE = f"https://graph.facebook.com/{META_GRAPH_API_VERSION}"
|
|
15
15
|
USER_AGENT = "meta-ads-mcp/1.0"
|
|
16
16
|
|
|
@@ -187,7 +187,7 @@ class AuthManager:
|
|
|
187
187
|
def get_auth_url(self) -> str:
|
|
188
188
|
"""Generate the Facebook OAuth URL for desktop app flow"""
|
|
189
189
|
return (
|
|
190
|
-
f"https://www.facebook.com/
|
|
190
|
+
f"https://www.facebook.com/v22.0/dialog/oauth?"
|
|
191
191
|
f"client_id={self.app_id}&"
|
|
192
192
|
f"redirect_uri={self.redirect_uri}&"
|
|
193
193
|
f"scope={AUTH_SCOPE}&"
|
|
@@ -359,7 +359,7 @@ def exchange_token_for_long_lived(short_lived_token):
|
|
|
359
359
|
return None
|
|
360
360
|
|
|
361
361
|
# Make the API request to exchange the token
|
|
362
|
-
url = "https://graph.facebook.com/
|
|
362
|
+
url = "https://graph.facebook.com/v22.0/oauth/access_token"
|
|
363
363
|
params = {
|
|
364
364
|
"grant_type": "fb_exchange_token",
|
|
365
365
|
"client_id": app_id,
|
|
@@ -418,7 +418,7 @@ class PipeboardAuthManager:
|
|
|
418
418
|
|
|
419
419
|
try:
|
|
420
420
|
# Make a simple request to the /me endpoint to test the token
|
|
421
|
-
META_GRAPH_API_VERSION = "
|
|
421
|
+
META_GRAPH_API_VERSION = "v22.0"
|
|
422
422
|
url = f"https://graph.facebook.com/{META_GRAPH_API_VERSION}/me"
|
|
423
423
|
headers = {"Authorization": f"Bearer {self.token_info.access_token}"}
|
|
424
424
|
|
|
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "meta-ads-mcp"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.1"
|
|
8
8
|
description = "Model Calling Protocol (MCP) plugin for interacting with Meta Ads API"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
11
11
|
authors = [
|
|
12
|
-
{name = "
|
|
12
|
+
{name = "Yves Junqueira", email = "yves.junqueira@gmail.com"},
|
|
13
13
|
]
|
|
14
14
|
keywords = ["meta", "facebook", "ads", "api", "mcp", "claude"]
|
|
15
15
|
license = {text = "MIT"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
startCommand:
|
|
2
|
+
type: stdio
|
|
3
|
+
configSchema:
|
|
4
|
+
type: object
|
|
5
|
+
properties:
|
|
6
|
+
pipeboardApiToken:
|
|
7
|
+
type: string
|
|
8
|
+
description: "Pipeboard API token for Meta authentication (recommended). Get your free token at https://pipeboard.co"
|
|
9
|
+
metaAppId:
|
|
10
|
+
type: string
|
|
11
|
+
description: "Meta App ID (Client ID) for direct OAuth method (only needed if not using Pipeboard authentication)"
|
|
12
|
+
required: []
|
|
13
|
+
commandFunction: |
|
|
14
|
+
(config) => {
|
|
15
|
+
const env = {};
|
|
16
|
+
const args = ["-m", "meta_ads_mcp"];
|
|
17
|
+
|
|
18
|
+
// Add Pipeboard API token to environment if provided (recommended auth method)
|
|
19
|
+
if (config.pipeboardApiToken) {
|
|
20
|
+
env.PIPEBOARD_API_TOKEN = config.pipeboardApiToken;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Add Meta App ID as command-line argument if provided (alternative auth method)
|
|
24
|
+
if (config.metaAppId) {
|
|
25
|
+
args.push("--app-id", config.metaAppId);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
command: 'python',
|
|
30
|
+
args: args,
|
|
31
|
+
env: env
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -26,7 +26,7 @@ from meta_ads_mcp.core.pipeboard_auth import pipeboard_auth_manager, PIPEBOARD_A
|
|
|
26
26
|
from meta_ads_mcp.api import get_ad_accounts
|
|
27
27
|
|
|
28
28
|
# Define Meta Graph API base URL for testing access token directly
|
|
29
|
-
META_GRAPH_API_VERSION = "
|
|
29
|
+
META_GRAPH_API_VERSION = "v22.0"
|
|
30
30
|
META_GRAPH_API_BASE = f"https://graph.facebook.com/{META_GRAPH_API_VERSION}"
|
|
31
31
|
|
|
32
32
|
def test_server_connectivity(server_url, port=3000):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|