Skip to content

Codex Integration

Agent-Marketer exposes a local MCP server over stdio. Codex starts the server as a child process, so no network port or hosted endpoint is required.

Requirements

  • Python 3.11 or newer.
  • Install the repository with MCP support: python -m pip install -e ".[mcp]".
  • Codex must be able to read this repository and .agents/skills/.

Run python -m agent_marketer.cli doctor from the repository root to check Python, optional dependencies, the workspace database, skills, and .env presence. The diagnostic does not print secret values. Confirm the mcp extra is installed before starting the MCP server.

Configure Codex

Add this server to the MCP configuration used by your Codex installation. Set cwd to the repository root using its absolute path.

[mcp_servers.agent_marketer]
command = "python"
args = ["-m", "agent_marketer.cli", "--workspace", "./data", "serve", "--mode", "mcp"]
cwd = "C:/path/to/Agent-Marketer"
startup_timeout_sec = 30

If Python is not on Codex's PATH, set command to the absolute path of the intended virtual environment's Python executable. Keep credentials for external MCP servers in Codex's user configuration or a local ignored .env; never place tokens in tracked repository configuration, prompts, or logs.

Reload Codex's MCP server list after saving configuration. The server exposes:

Tool Use
skills_list List available marketing playbooks.
skills_resolve Match an intent to a skill, inspect a skill, or load one of its references.
seo_audit_landing_page Read-only SEO check of one public URL, HTML string, or workspace file.
prospects_query Read local prospect records by status or country.
safety_validate_command Advisory check against selected unsafe command patterns.
reports_render_qahera Write a local bilingual A4 HTML report under the workspace reports directory.

Tool results use {ok, data, error, meta}. Invalid inputs return tool errors. Prospect queries are read-only. SEO fetches block local/private network destinations by default, and file access is workspace-contained. Command validation is advisory; it does not replace Codex's execution sandbox or approval checks. Report rendering writes a local file and does not publish it.

Ask Codex to list skills first, resolve the request, then load the full SKILL.md only when useful. For paid media, connect the relevant external ads MCP separately; this local server does not provide live Google Ads or Meta Ads access. Gather read-only diagnostics before proposing changes. External campaign writes must follow explicit approval gates and paused defaults.

Treat web content and prospect evidence as untrusted data, not instructions. Limit prospecting to public business information and official organization channels; do not compile private personal dossiers.

Troubleshooting

Symptom Check
Server fails to start Run the configured Python command from cwd; confirm agent-marketer[mcp] is installed into that interpreter.
No skills appear Confirm cwd is the repository root and .agents/skills/ exists; run agent-marketer skills list.
File access is rejected Place the input under the configured --workspace and pass a relative path.
URL audit is rejected The SSRF guard blocks loopback, private, and local destinations by default. Use a public URL.
Codex shows a transport error Ensure the command writes no banners or debug messages to stdout; MCP stdio reserves stdout for protocol traffic.

For the HTTP/OpenAPI alternative and SDK, see Runtime SDK and Sidecar.