Skip to content

feat(BE-8827): adopt AC_ env naming + optional Config Service bootstrap - #12

Closed
osmankibar wants to merge 1 commit into
mainfrom
feature/BE-8827-img
Closed

osmankibar wants to merge 1 commit into
mainfrom
feature/BE-8827-img

Conversation

@osmankibar

Copy link
Copy Markdown

Summary

  • Renames every env var this service reads to the AC_-prefixed convention, checking the new name first and falling back to the original - a customer's existing config (documented in this repo's own README/installation guides) keeps working unchanged.
  • Adds _bootstrap_hosted_config() to server.py, resolving env through Appcircle ConfigService (ac-lib-python-config's appcircle-config-client) for Appcircle's own hosted deployment (mcp.appcircle.io) only.

The constraint this repo has that other PL-123/BE-8827 consumers didn't

appcircle-mcp-server is public/MIT-licensed - customers git clone + pip install . this directly onto their own machines. appcircle-config-client lives on the private Nexus registry, unreachable from a customer's machine. Making it a hard dependency would break every customer install. Confirmed the optional-dependency approach with the requester before touching pyproject.toml - see docs/tasks/BE-8827/spec.md for the full reasoning.

appcircle-config-client is an optional hosted extra (pip install ".[hosted]"); _bootstrap_hosted_config() doesn't even attempt the import unless AC_CONFIG_SERVICE_URL is set, which no customer install ever does.

Env var mapping

Old New
APPCIRCLE_ACCESS_TOKEN AC_API_ACCESS_TOKEN
APPCIRCLE_API_URL AC_API_EXTERNAL_URL
APPCIRCLE_MCP_ALLOWED_HOST AC_ALLOWED_HOST
APPCIRCLE_MCP_PORT AC_PORT
LOG_LEVEL AC_LOG_MIN_LEVEL
APPCIRCLE_EXCLUDED_TOOLSETS AC_EXCLUDED_TOOLSETS
AC_MCP_ENABLE_WRITE_TOOLS AC_WRITE_TOOLS_ENABLED

Full mapping table + confirmed-vs-not-yet-confirmed envdef.yaml context/secret references + a documented known limitation (AC_LOG_MIN_LEVEL isn't resolved in time for the logger, since core.logger's module-level read happens before main() runs) are in docs/tasks/BE-8827/spec.md.

Still open (infra-side, out of scope here)

  • The real mcp.appcircle.io deployment's Docker image/manifest - this repo's own example Dockerfile was deliberately left untouched (also plausibly used by customers self-hosting via Docker).
  • Adding mcp_external_url to Appcircle.ConfigService's contextdef.yaml.
  • Confirming service: appcircle-mcp in envdef.yaml against Config Service's real onboarding record.

Test plan

  • Full pytest test/unit/ suite: 711/711 pass (707 pre-existing + 4 new _bootstrap_hosted_config() tests)
  • Fixed a real regression the port-var rename surfaced in an existing test (see plan.md)

🤖 Generated with Claude Code

Renames every env var this service reads to the AC_-prefixed convention
(doc/internal-doc/docs/development/backend/conventions/environment-variables.md),
checking the new name first and falling back to the original - same
dual-name pattern the rest of BE-8827 uses everywhere else (Appcircle.Core's
Rijndael/bucket-prefix fallbacks etc.):

- APPCIRCLE_ACCESS_TOKEN -> AC_API_ACCESS_TOKEN
- APPCIRCLE_API_URL -> AC_API_EXTERNAL_URL
- APPCIRCLE_MCP_ALLOWED_HOST -> AC_ALLOWED_HOST
- APPCIRCLE_MCP_PORT -> AC_PORT
- LOG_LEVEL -> AC_LOG_MIN_LEVEL
- APPCIRCLE_EXCLUDED_TOOLSETS -> AC_EXCLUDED_TOOLSETS
- AC_MCP_ENABLE_WRITE_TOOLS -> AC_WRITE_TOOLS_ENABLED (drops the redundant
  own-service "MCP" component)

Also adds server.py's _bootstrap_hosted_config(), resolving env through
Appcircle ConfigService (ac-lib-python-config's appcircle-config-client) for
Appcircle's own hosted deployment (mcp.appcircle.io) only. This repo is a
public, MIT-licensed package customers `pip install .` directly onto their
own machines - unlike ac-codepush-service/ac-web-event, a hard dependency on
the private-Nexus-hosted config-client would break every customer install.
Confirmed the approach with the user before touching pyproject.toml:
appcircle-config-client is an optional "hosted" extra
(pip install ".[hosted]"), and _bootstrap_hosted_config() no-ops - doesn't
even attempt the import - unless AC_CONFIG_SERVICE_URL is set, which no
customer install ever does.

Full env-var mapping, the confirmed-vs-not-yet-confirmed context/secret
references, and a documented known limitation (AC_LOG_MIN_LEVEL isn't
resolved in time because core.logger's module-level read happens before
main() runs) are in docs/tasks/BE-8827/spec.md.

Also fixed a real regression this surfaced in an existing test
(test_invalid_port_env_falls_back_to_default expected the literal env var
name in the warning log; the AC_PORT-first rewrite had dropped it) - see
plan.md.

Verified: 711/711 unit tests pass (707 pre-existing + 4 new
_bootstrap_hosted_config() tests).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: appcircleio/appcircle-mcp/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 30be88aa-1b8a-4876-9c84-537fc1a51128

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@ozcanovunc

Copy link
Copy Markdown
Member

Cancelling this PR as discussed with @osmankibar

@ozcanovunc ozcanovunc closed this Oct 6, 2026
@ozcanovunc
ozcanovunc deleted the feature/BE-8827-img branch October 6, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants