We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/get-convex/convex-backend'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
use fastrace::prelude::SpanContext;
use tonic::service::Interceptor;
use crate::http::TRACEPARENT_HEADER_STR;
/// An interceptor that injects the `traceparent` header so that the called
/// service can continue tracing.
#[derive(Copy, Clone, Debug)]
pub struct TraceparentPopulatingInterceptor;
impl Interceptor for TraceparentPopulatingInterceptor {
fn call(
&mut self,
mut request: tonic::Request<()>,
) -> Result<tonic::Request<()>, tonic::Status> {
if let Some(ctx) = SpanContext::current_local_parent()
&& let Ok(value) = ctx.encode_w3c_traceparent().try_into()
{
request.metadata_mut().insert(TRACEPARENT_HEADER_STR, value);
}
Ok(request)
}
}