Skip to content

Meta Ads (Facebook/Instagram) MCP server for Claude, ChatGPT, Perplexity & Cursor — the Meta node of Pipeboard’s 5-platform family (+ Google, TikTok, Snap, Reddit). Hosted remote MCP, badged Meta Business Partner, free plan — no self-hosting required.

Update .gitignore, remove deprecated meta_ads_generated.py, and adjust imports in test_meta_ads_auth.py

Yves Junqueirae839873156f7
diff --git a/.gitignore b/.gitignore
index aa0778f..5d386a9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,13 @@ wheels/
.venv
.cursor/rules/meta-ads-credentials.mdc
.DS_Store
+
+# Development environment files
+.python-version
+poetry.lock
+uv.lock
+.uv.toml
+.cursor/
+
+# Generated content
+ad_creatives/
diff --git a/meta_ads_generated.py b/meta_ads_generated.py
deleted file mode 100644
index 17654e6..0000000
--- a/meta_ads_generated.py
+++ /dev/null
@@ -1,66 +0,0 @@
-"""
-Meta Ads Generated - Backward compatibility wrapper
-
-This file maintains backward compatibility with the previous monolithic version
-by importing and re-exporting all functionality from the new modular structure.
-"""
-
-import os
-import sys
-
-# Add the current directory to the path so we can import the package
-if os.path.dirname(os.path.abspath(__file__)) not in sys.path:
- sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
-
-# Import and re-export all required functions and classes
-from meta_ads_mcp.core.server import mcp_server
-from meta_ads_mcp.core.auth import (
- auth_manager, needs_authentication, token_container,
- CallbackHandler, TokenInfo, AuthManager, start_callback_server,
- get_current_access_token, login
-)
-from meta_ads_mcp.core.api import (
- META_GRAPH_API_VERSION, META_GRAPH_API_BASE, USER_AGENT,
- GraphAPIError, make_api_request, meta_api_tool
-)
-from meta_ads_mcp.core.utils import (
- ad_creative_images, download_image, try_multiple_download_methods,
- create_resource_from_image
-)
-from meta_ads_mcp.core.accounts import (
- get_ad_accounts, get_account_info
-)
-from meta_ads_mcp.core.campaigns import (
- get_campaigns, get_campaign_details, create_campaign
-)
-from meta_ads_mcp.core.adsets import (
- get_adsets, get_adset_details, update_adset
-)
-from meta_ads_mcp.core.ads import (
- get_ads, get_ad_details, get_ad_creatives, get_ad_image
-)
-from meta_ads_mcp.core.insights import (
- get_insights, debug_image_download, save_ad_image_via_api
-)
-from meta_ads_mcp.core.authentication import (
- get_login_link
-)
-from meta_ads_mcp.core.resources import (
- list_resources, get_resource
-)
-from meta_ads_mcp.core.server import (
- login_cli, main
-)
-
-# Add the resource routes to maintain backward compatibility
-mcp_server.resource(uri="meta-ads://resources")(list_resources)
-mcp_server.resource(uri="meta-ads://images/{resource_id}")(get_resource)
-
-# Initialize with default app ID, will be updated at runtime
-META_APP_ID = os.environ.get("META_APP_ID", "YOUR_META_APP_ID")
-if META_APP_ID != "YOUR_META_APP_ID":
- auth_manager.app_id = META_APP_ID
-
-# This allows the script to be run directly
-if __name__ == "__main__":
- main()
\ No newline at end of file
diff --git a/meta_ads_mcp/__init__.py b/meta_ads_mcp/__init__.py
index 33b35de..8c2b329 100644
--- a/meta_ads_mcp/__init__.py
+++ b/meta_ads_mcp/__init__.py
@@ -35,4 +35,7 @@ from .core import (
# Define a main function to be used as a package entry point
def entrypoint():
"""Main entry point for the package when invoked with uvx."""
- return main()
\ No newline at end of file
+ return main()
+
+# Re-export main for direct access
+main = main
\ No newline at end of file
diff --git a/test_meta_ads_auth.py b/test_meta_ads_auth.py
index 2653565..e521f87 100644
--- a/test_meta_ads_auth.py
+++ b/test_meta_ads_auth.py
@@ -10,7 +10,8 @@ import json
import os
# Import the auth manager from our Meta Ads MCP module
-from meta_ads_generated import auth_manager, get_ad_accounts
+from meta_ads_mcp.core.auth import auth_manager
+from meta_ads_mcp.core.accounts import get_ad_accounts
async def test_authentication(app_id=None, force_login=False):
"""Test the authentication flow and run a simple command"""
diff --git a/uv.lock b/uv.lock
index 5762e22..f16321c 100644
--- a/uv.lock
+++ b/uv.lock
@@ -206,7 +206,7 @@ wheels = [
[[package]]
name = "meta-ads-mcp"
-version = "0.2.1"
+version = "0.2.2"
source = { editable = "." }
dependencies = [
{ name = "httpx" },